页面地址是 abc.com/xxx.php ,想让访问 xxx.abc.com 等效于访问 abc.com/xxx.php ,如何才能做到?如果 rewrite 不可以,那么利用 php 该如何写,或者还有没有其他办法?
页面地址是 abc.com/xxx.php ,想让访问 xxx.abc.com 等效于访问 abc.com/xxx.php ,如何才能做到?如果 rewrite 不可以,那么利用 php 该如何写,或者还有没有其他办法?
|
kukeSep 6, 2017
1
在 conf 配置里设置一下 DirectoryIndex xxx.php
|
|
FamioSep 7, 2017
2
RewriteEngine On
RewriteCond %{HTTP_HOST} ^abc.com RewriteCond %{REQUEST_URI} !^xxx.php$ RewriteCond %{REQUEST_URI} .php$ RewriteRule (.*).php$ http://$1.abc.com/ [R] 好久没写了,不知道对不对 |