.htaccess - Rewrite Rule not Working in IIS Server with PHP -
hi, friends. i'm creating .htaccess file rewrite rules. it's working fine in localhost, on live, server it's not working. hosting uses window server.
i wrote rule in .htaccess file:
rewriteengine on rewritebase /project_name/ rewritecond %{request_filename} !-f rewritecond %{request_uri} !example.php rewritecond %{request_uri} !(.*)/$ rewriterule (.*) pages.php?page_slug=$1 [l]
for case of wordpress run on iis server , need create web.config in root directory put code below,
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.webserver> <rewrite> <rules> <rule name="wordpress" stopprocessing="true"> <match url=".*" /> <conditions logicalgrouping="matchall"> <add input="{request_filename}" matchtype="isfile" negate="true" /> <add input="{request_filename}" matchtype="isdirectory" negate="true" /> </conditions> <action type="rewrite" url="index.php" /> </rule> </rules> </rewrite> </system.webserver> </configuration>
Comments
Post a Comment