.htaccess文件和子目录

时间:2014-03-18 17:47:38

标签: apache .htaccess

我有一个包含此文件系统的域:

  

/根/的public_html / subdirectory1 / subdirectory2 /

subdirectory1内,我有一个index.html,但我的域名的主要内容是

/subdirectory2/index.php (wordpress cms)

我希望如果用户写www.dominio.com,它就像

一样
www.dominio.com/subdirectory2/index.php

我必须在/public_html//subdirectory1/中插入哪些.htaccess文件?

我做了一些尝试,但我只能做以下事情:

WWW.domain.com - > www.domain.com/subdirectory1/index.html(这有效!)

1)。public_html中的.HTACCESS FILE

# Do not change this line. 
RewriteEngine on 
# Change example.com to be your main domain. 
 RewriteCond %{HTTP_HOST} ^(www.)?dominio.com$ 
# Change 'subdirectory' to be the directory you will use for your main domain. 
 RewriteCond %{REQUEST_URI} !^/subdirectory1/
# Don't change the following two lines. 
 RewriteCond %{REQUEST_FILENAME} !-f 
 RewriteCond %{REQUEST_FILENAME} !-d 
# Change 'subdirectory' to be the directory you will use for your main domain. 
 RewriteRule ^(.*)$ /subdirectory1/$1 
 RewriteCond %{HTTP_HOST} ^(www.)?dominio.com$ 
 RewriteRule ^(/)?$ subdirectory1/index.html [L]

0 个答案:

没有答案