[英]Show root pages without changing url of the sub folder htaccess rules
我有wordpress网站abc.com,网址格式为
网址1:abc.com/Rebeka/
网址2:abc.com/shops/Rebeka/
例如,此处的Rebeka是存在于根目录(URL 1)上的帖子名称,但不存在于/ shops /文件夹下。
在这里,我想保持两个url正常工作,只有更改是/ shops /文件夹才能显示根目录中的帖子(如果缺少任何帖子)。
您能帮我了解/ shops /文件夹或根文件夹的htaccess规则吗? 或其他解决方案?
在htaccess文件根目录中:
RewriteEngine on
#If /shop/foobar file does not exist
RewriteCond %{DOCUMENT_ROOT}/shop/$1 !-f
#rewrite /shop/foobar to /foobar (root)
RewriteRule ^shop/([^/]+)/?$ /$1 [L]
这应该可以正常工作:
RewriteEngine On
RewriteRule /shops/(.*) /$1 [L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.