2012-04-15 93 views

回答

1

与htaccess的例如

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule .* index.php [L] 

改写一切是不是一个物理文件或文件夹到的index.php

做硬重定向/到的index.php做

RedirectMatch ^/$ http://sub.exmaple.com/index.php 
+0

它不工作? – 2012-04-15 08:44:44

+0

您是否正确地配置了您的Web服务器/虚拟主机以允许.htaccess覆盖值? – 2012-04-15 08:48:05

+0

是的,我有,去sub.example.com只是给sub.example.com? – 2012-04-15 08:50:34