我正在尝试像这样重定向我的链接:
我的链接=example.com/?p=users&page=2
我的网址应该是 =example.com/users/page/2
此时,我的 mod_rewrite 正在处理:
我的链接=example.com/?p=users
我的网址=example.com/users
这是我的 htaccess:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/index.php
RewriteRule ^(.*)$ index.php?p=$1 [L,QSA]
</IfModule>
完整的 .htaccess 如下:
Options +FollowSymLinks
RewriteEngine On
# skip all files and directories from rules below
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# skip index.php from any rules below
RewriteRule ^index\.php$ - [L,NC]
# handle /users/page/2 URI
RewriteRule ^([\w-]+)/([\w-]+)/(\d+)/?$ index.php?p=$1&$2=$3 [L,QSA]
# handle /users URI
RewriteRule ^([\w-]+)/?$ index.php?p=$1 [L,QSA]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)