Php htaccess问题-未重写url
我知道这个问题以前被问过很多次,但我需要帮助。我花了好几个小时在这上面,我不知道下面的Php htaccess问题-未重写url,php,apache,.htaccess,mod-rewrite,Php,Apache,.htaccess,Mod Rewrite,我知道这个问题以前被问过很多次,但我需要帮助。我花了好几个小时在这上面,我不知道下面的htaccess代码到底出了什么问题 Options +FollowSymLinks RewriteEngine on RewriteRule services/z/(.*)/ services.php?z=$1 RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://rcunlocks.com/$1 [R,L] 我正在尝试重新编写url ht
htaccess
代码到底出了什么问题
Options +FollowSymLinks
RewriteEngine on
RewriteRule services/z/(.*)/ services.php?z=$1
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://rcunlocks.com/$1 [R,L]
我正在尝试重新编写url
https://rcunlocks.com/services.php?z=spus3
到
https://rcunlocks.com/services/spus3
如果我的htaccess文件有任何问题,请告诉我
非常感谢你的帮助。谢谢。试试这个
Options +FollowSymlinks
RewriteEngine on
# check that the request url is neither a file nor a directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^services/(.*) services.php?z=$1 [NC]
试试这个
Options +FollowSymlinks
RewriteEngine on
# check that the request url is neither a file nor a directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^services/(.*) services.php?z=$1 [NC]
我看到两个问题:
/services.php?z=spus3
MultiViews
可以覆盖此重写规则Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=302,L]
RewriteRule ^services/z/([^/]+)/?$ services.php?z=$1 [L,QSA,NC]
我看到两个问题:
/services.php?z=spus3
MultiViews
可以覆盖此重写规则Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=302,L]
RewriteRule ^services/z/([^/]+)/?$ services.php?z=$1 [L,QSA,NC]
我猜你必须在你的规则后添加
[NC,L]
,因为最后一条规则会将所有内容重写回默认结构。我猜你必须在规则后添加[NC,L]
,因为最后一条规则会将所有内容重写回默认结构。我尝试了,但仍然没有成功。我想我会阻止它,让它转到下一个重写规则。。我说的对吗?输入https://rcunlocks.com/services/spus3
URL在浏览器中?我得到了一个多选页面-状态300好吧,这意味着超出了这些规则,因为我的所有规则都没有返回状态=300。我试过了,仍然没有成功。我想我会阻止它,让它转到下一个重写规则。。我说的对吗?输入https://rcunlocks.com/services/spus3
URL在浏览器中?我得到了一个多选页面-状态300,这意味着超出了这些规则,因为我的所有规则都没有返回状态=300