我想使用htaccess将链接http://example.com/asdasdas/edit重定向到http://example.com/asdasdas/index.php/edit。我这样做了:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} edit
RewriteRule ^ %{REQUEST_URI}/index.php [L,R=301]
但它是一个循环并且效果不佳。有任何想法吗?
答案 0 :(得分:0)
您可以在/asdasdas/.htaccess
:
RewriteEngine On
RewriteBase /asdasdas/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.+) index.php/$ [L]
这将支持http://example.com/asdasdas/edit