我创建了一个名为 services 的子域,我想将它重定向到一个文件夹,但我无法让它工作。
我试过了:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
RewriteCond %{HTTP_HOST} ^services\.\.com.br$
RewriteRule ^/$ http://subdomain.mydomaintest/services/ [R,L]
文件夹的路径是 mydomain/web/services
答案 0 :(得分:2)
这应该适合你:
# subdomain to subfolder
RewriteEngine on
RewriteCond %{HTTP_HOST} ^services\.com.br$
RewriteRule !service /services%{REQUEST_URI} [L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress