【发布时间】:2020-03-31 10:12:38
【问题描述】:
example.com/wp
或者
example.com/wp/
我的静态页面(其中几个 tbh)存储在 root/subf1/
我能够重定向到所需的子文件夹,但路径也显示在 URL 中。 是否可以将 example.com/subf1 更改为 example/wp?
这是我当前的 htaccess。也许我需要在静态页面文件夹中创建另一个?
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteCond %{REQUEST_URI} !^/subf1/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /test/page/$1
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteRule ^(/)?$ /subf1/index.html [L]
</IfModule>
RedirectMatch "^/wp$" "https://example.com/subf1/"
非常感谢您的宝贵时间
【问题讨论】:
标签: regex wordpress apache web server