.htaccess htaccess:第一场比赛后如何停止
这是我的htaccess文件:.htaccess htaccess:第一场比赛后如何停止,.htaccess,mod-rewrite,cpanel,.htaccess,Mod Rewrite,Cpanel,这是我的htaccess文件: <IfModule mod_rewrite.c> # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteRule ^getlastversion(.*)$ /lastversion.php$1 [R=301,NC,L,QSA] # this is temporary and should b
<IfModule mod_rewrite.c>
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^getlastversion(.*)$ /lastversion.php$1 [R=301,NC,L,QSA]
# this is temporary and should be removed
RewriteRule ^(.*)$ http://example\.com\?$1 [R=301,NC,L,QSA]
</IfModule>
#打开mod_rewrite
重新启动发动机
重写基/
重写规则^getlastversion(.*)/lastversion.php$1[R=301,NC,L,QSA]
#这是暂时的,应该删除
重写规则^(.*)$http://example\.com\?$1[R=301,NC,L,QSA]
浏览
mysite.com/getlastversion
重定向到example.com?lastversion.php
(第二条规则),而我需要将其重定向到/lastversion.php
(第一条规则)您可以在具有负前瞻条件的情况下尝试此规则:
重新编写引擎打开
重写基/
重写规则^getlastversion(.*)/lastversion.php$1[R=301,NC,L,QSA]
#这是暂时的,应该删除
重写规则^(?!lastversion\.php)(.*)$http://example.com?$1[R=301,北卡罗来纳州,北卡罗来纳州]
(?!lastversion\.php)
是负前瞻,如果URL开头有/lastversion.php
,它将跳过此规则
请确保在完全清除浏览器缓存后测试此规则。根据显示的示例,请尝试以下操作。请确保在测试URL之前清除缓存
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^getlastversion(.*)/?$ /lastversion.php$1 [R=301,NC,L,QSA]
# this is temporary and should be removed
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !lastversion\.php [NC]
RewriteRule ^(.*)$ http://example.com?$1 [R=301,NC,L]
你好,亚历克斯,我可以在这里问一下吗?你能告诉我们我们的解决方案进展如何吗?非常感谢。