.htaccess 如果URI包含index.php的字符串,则htaccess重定向

.htaccess 如果URI包含index.php的字符串,则htaccess重定向,.htaccess,redirect,.htaccess,Redirect,我想将链接重定向到使用htaccess。我这样做: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} edit RewriteRule ^ %{REQUEST_URI}/index.php [L,R=301] 但这是一个循环,不能很好地工作。有什么想法吗 您可以在/asdasdas/.htaccess中使用此规则:

我想将链接重定向到使用htaccess。我这样做:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} edit
RewriteRule ^ %{REQUEST_URI}/index.php [L,R=301]

但这是一个循环,不能很好地工作。有什么想法吗

您可以在
/asdasdas/.htaccess
中使用此规则:

RewriteEngine On
RewriteBase /asdasdas/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.+) index.php/$ [L]
这将支持
http://example.com/asdasdas/edit