Home >Backend Development >PHP Tutorial >二级域名伪静态怎么弄(htaccess)

二级域名伪静态怎么弄(htaccess)

WBOY
WBOYOriginal
2016-06-23 13:48:291271browse

两个域名都能正常访问(同IP,常规的二级域名)
domain.com       
second.domain.com
想实现的是 
second.domain.com/abc  跳转到   second.domain.com?c=abc

.htaccess是这样的,现在一切正常

.............RewriteRule ^good$ test/good.php          //domain.com/good  正常访问RewriteCond %{HTTP_HOST} ^second.domain.com$ [NC]RewriteRule ^/(.*)$       /?c=$1      //second.domain.com/abc    404


控制台输出 second.domain.com/abc   404未找到
原因出在什么地方?望高手回答



回复讨论(解决方案)

abc目录下重新建一个.htaccess
然后再
RewriteRule ^/(.*)$       /?c=$1

恍然大悟啊,太感谢了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn