Friendly URL in hosting Windows 2003/2008 with site in PHP

1

I need to convert this file .htaccess to a format compatible with a Windows hosting in Locaweb.

RewriteEngine On 
RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?link=$1 [L] 

In support with locaweb guide me to read this link. link

But I can not understand the difference, since the links work, what does not open are the files.

    
asked by anonymous 11.04.2014 / 13:40

1 answer

1

The URL Rewrite that is installed on IIS Server was used for this conversion, where I use to run my sites with Friendly URL for PHP.

  

Link to Install Extension: link

As you should not have installed IIS, I converted it to you by the configuration passed in the question and would look like this with Rewrite .

Create a file with this name and extension web.config and paste inside that Xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1" enabled="false" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{SCRIPT_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                        <add input="{SCRIPT_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php?link={R:1}" appendQueryString="false" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

It has a but, this rule can work if it is the only .htaccess in your project, if you have more you have to generate one for each ...     

11.04.2014 / 15:32