Home  >  Article  >  Backend Development  >  问个.htaccess通用写法如何写

问个.htaccess通用写法如何写

WBOY
WBOYOriginal
2016-06-13 12:42:20951browse

问个.htaccess通用写法怎么写

RewriteCond %{HTTP_HOST} ^xxx.rtkuhn.com$ [NC]<br />
RewriteCond %{REQUEST_URI} !^/xxx/<br />
RewriteRule ^(.*)$ /xxx/$1<br />
RewriteCond %{HTTP_HOST} ^xxx.rtkuhn.com$<br />
RewriteRule ^(/)?$ /xxx/index.htm [L]<br />

这段代码可以自动重写名字为xxx的子目录文件夹为二级域名,我想问下现在我有上百个这样的子目录,一个一个添加的话会很麻烦,通用的规则该怎么写呢?谢谢!

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