【发布时间】:2023-03-23 22:06:01
【问题描述】:
我有一个带有“.htaccess”文件的子目录,我想要的是当这个文件收到请求时,根目录中的索引执行而不改变文件中的位置..
子目录位置:'public_html/subdomains/news'
我写了'.htaccess'文件如下
RewriteEngine on
RewriteCond %{HTTP_HOST} ^news\.example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.news\.example\.com$
RewriteRule ^/?$ ../../index.php?url=news [L,QSA,NC]
但没用
由于这个subDir属于一个subDomain,我不希望它的地址改变,我希望用户访问位置地址:
http://www.example.com/news
通过调用地址:
http://news.example.com
他们没有看到
【问题讨论】:
标签: php apache .htaccess mod-rewrite subdomain