Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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
.htaccess htaccess重写特定页面的代码_.htaccess - Fatal编程技术网

.htaccess htaccess重写特定页面的代码

.htaccess htaccess重写特定页面的代码,.htaccess,.htaccess,我正在我的htaccess文件中使用此重写规则: RewriteRule ^([\w/-]+)/?$ index.php?page_slug=$1 [L, QSA] 我如何以与上述相同的方式将domain.com/online shop/重定向到domain.com/online shop/home RewriteRule ^(online-shop)/?$ /$1/home [L,NC,R=302] RewriteCond %{REQUEST_FILENAME} !-d RewriteRu

我正在我的
htaccess
文件中使用此重写规则:

RewriteRule ^([\w/-]+)/?$ index.php?page_slug=$1 [L, QSA]

我如何以与上述相同的方式将
domain.com/online shop/
重定向到
domain.com/online shop/home

RewriteRule ^(online-shop)/?$ /$1/home [L,NC,R=302]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^((?!online-shop/)[\w/-]+)/?$ index.php?page_slug=$1 [L,QSA,NC]

我只想
online shop
显示/重定向到
online shop/home
,如果您不想更改URL,则从第一个规则中删除
R=302
。为什么要在其中加入两个不同的规则?一个是您已经存在的规则,另一个是您的需求所需要的规则。