我的.htaccess
RewriteCond %{REQUEST_URI} ^/(poodle|mandy|sandy|nova|wendy) [NC]
RewriteRule ^.*$ /wendy/index.php#%1 [L]在这里,我能够重定向所有文件夹,而无需更改url。
但是当我尝试重定向子域名时
喜欢
wendy.xxxxxx.com/ggsgs/sfghdsgd.html我收到内部服务器错误。
无论如何,我可以将所有子域重定向到wendy/index.php,而无需更改url。
谢谢。
发布于 2016-05-31 23:54:10
你不应该在.htaccess中管理域名重定向。它应该在apache配置中使用VirtualHosts进行配置,如下所示:
<VirtualHost *:80>
Servername name1
ServerAlias name2
ServerAlias name3
[...]
</Virtualhost>如果您想要重定向任何子域,可以使用通配符:
ServerAlias *.example.comhttps://stackoverflow.com/questions/37549371
复制相似问题