Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php htaccess只忽略一条重写规则_Php_.htaccess_Mod Rewrite - Fatal编程技术网

Php htaccess只忽略一条重写规则

Php htaccess只忽略一条重写规则,php,.htaccess,mod-rewrite,Php,.htaccess,Mod Rewrite,在我的htaccess文件中,我定义了一些规则,除一个规则外,所有规则都有效 html链接是 <a href="Games-name-of-game">Name of game</a> 当我点击上面的链接时,它会将游戏名称重定向到/gameDescription.php?Games=游戏名称 除此之外,所有其他规则[重定向]都正常工作 我的Htaccess Options All -Indexes <files .htaccess> order allow

在我的htaccess文件中,我定义了一些规则,除一个规则外,所有规则都有效

html链接是

<a href="Games-name-of-game">Name of game</a>
当我点击上面的链接时,它会将游戏名称重定向到/gameDescription.php?Games=游戏名称

除此之外,所有其他规则[重定向]都正常工作

我的Htaccess

Options All -Indexes

<files .htaccess>
order allow,deny
deny from all
</files>

RewriteEngine on
RewriteCond %{ENV:REDIRECT_STATUS} ^$

RewriteRule ^Games-([^/]*)$ /gameDescription.php?game=$1 [NC]
RewriteRule ^Home$ /index.php [NC]
RewriteRule ^Games$ /games.php [NC]
RewriteRule ^News$ /news.php [NC]
RewriteRule ^Videos$ /videos.php [NC]
RewriteRule ^Contact$ /contact.php [NC]
RewriteRule ^About$ /about.php [NC]
RewriteRule ^Privacy$ /privacy.php [NC]
RewriteRule ^Ideas$ /gameDesign.php [NC]
RewriteRule ^Profile$ /profile.php [NC]

RewriteRule ^Search/Query/([^/]*)$ /search.php?query=$1 [NC]
选项所有-索引
命令允许,拒绝
全盘否定
重新启动发动机
RewriteCond%{ENV:REDIRECT_STATUS}^$
重写规则^Games-([^/]*)$/gamesdescription.php?game=$1[NC]
重写规则^Home$/index.php[NC]
重写规则^Games$/Games.php[NC]
重写规则^News$/News.php[NC]
重写规则^Videos$/Videos.php[NC]
重写规则^Contact$/Contact.php[NC]
重写规则^About$/About.php[NC]
重写规则^Privacy$/Privacy.php[NC]
重写规则^Ideas$/gameDesign.php[NC]
重写规则^Profile$/Profile.php[NC]
重写规则^Search/Query/([^/]*)$/Search.php?Query=$1[NC]

修复-从规则中删除了文字游戏,一切都正常运行

这是我的最新访问权限

Options All -Indexes

<files .htaccess>
order allow,deny
deny from all
</files>

RewriteEngine on
RewriteCond %{ENV:REDIRECT_STATUS} ^$

RewriteRule ^Home$ /index.php [NC]
RewriteRule ^Games$ /games.php [NC,L]
RewriteRule ^News$ /news.php [NC]
RewriteRule ^Videos$ /videos.php [NC]
RewriteRule ^Contact$ /contact.php [NC]
RewriteRule ^About$ /about.php [NC]
RewriteRule ^Privacy$ /privacy.php [NC]
RewriteRule ^Ideas$ /gameDesign.php [NC]
RewriteRule ^Profile$ /profile.php [NC]

RewriteRule ^Title-([^/]*)$ /desc.php?game=$1 [NC]

RewriteRule ^Search/Query/([^/]*)$ /search.php?query=$1 [NC]
选项所有-索引
命令允许,拒绝
全盘否定
重新启动发动机
RewriteCond%{ENV:REDIRECT_STATUS}^$
重写规则^Home$/index.php[NC]
重写规则^Games$/Games.php[NC,L]
重写规则^News$/News.php[NC]
重写规则^Videos$/Videos.php[NC]
重写规则^Contact$/Contact.php[NC]
重写规则^About$/About.php[NC]
重写规则^Privacy$/Privacy.php[NC]
重写规则^Ideas$/gameDesign.php[NC]
重写规则^Profile$/Profile.php[NC]
重写规则^Title-([^/]*)$/desc.php?游戏=$1[NC]
重写规则^Search/Query/([^/]*)$/Search.php?Query=$1[NC]

您需要发布所有其他内容,因为其中一个可能会造成干扰。请发布完整的htaccess。特别是因为您在此处没有
[L]
标志,在此之后将执行一个下线匹配。@MichaelBerkowski-我一直在玩游戏,添加了[L]标记,并注释了一些规则,但它仍然将URL还原为gameDescription.php?game=$1Try
href=“Games/name\u of_game”和
RewriteRule^Games/([^A-Za-z0-9\]*)$/gameDescription.php?Games=$1[NC]`
Options All -Indexes

<files .htaccess>
order allow,deny
deny from all
</files>

RewriteEngine on
RewriteCond %{ENV:REDIRECT_STATUS} ^$

RewriteRule ^Home$ /index.php [NC]
RewriteRule ^Games$ /games.php [NC,L]
RewriteRule ^News$ /news.php [NC]
RewriteRule ^Videos$ /videos.php [NC]
RewriteRule ^Contact$ /contact.php [NC]
RewriteRule ^About$ /about.php [NC]
RewriteRule ^Privacy$ /privacy.php [NC]
RewriteRule ^Ideas$ /gameDesign.php [NC]
RewriteRule ^Profile$ /profile.php [NC]

RewriteRule ^Title-([^/]*)$ /desc.php?game=$1 [NC]

RewriteRule ^Search/Query/([^/]*)$ /search.php?query=$1 [NC]