我有一个像www.abc.com/service/page.php这样的网站?ids=社交。我将网站重定向到www.abc.com/service/social。但是我需要从url.ex:www.abc.com/social中避开这个文件夹。
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteBase /service/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9]+|)/?$ page.php?ids=$1
最佳答案
只需从regex匹配中排除“service”:
RewriteRule ^service/([a-zA-Z0-9]+|)/?$ page.php?ids=$1
关于php - 子文件夹URL get参数在htaccess中不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/45101925/