我正在使用下面的htaccess从代码点火器的url中删除index.php。
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]问题是用户仍然可以使用下面的代码来访问该方法:
http://example.com/index.php/controller/method如果添加了,我如何将重定向到url而不使用index.php,或者将它们发送到错误页面?
发布于 2013-05-24 14:47:25
RewriteEngine On
RewriteRule ^index.php/(.*)$ /$1 [R=302,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]第一条规则随意地重定向用户非index.php站点,然后是第二条规则,并且是宾果。
https://stackoverflow.com/questions/16737120
复制相似问题