问题
I can not remove the index.php from url in IIS. Here my .htaccess file;
RewriteEngine on
RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|jquery|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]
also i tried the steps from codeigniter link but it didn't work for my server. it says only for apache servers. but im using iis server. even i enabled rewrite module but it didnt work again.
回答1:
You should include this in your Web.config
which is located in the root of your project:
<rule name="Remove index" 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>
来源:https://stackoverflow.com/questions/45127805/i-can-not-remove-index-php-from-url-in-codeigniter-in-iis-server