0
我JAVE的服务器有多个目录根:的Apache,根,子域和子目录
- /网站
- /论坛
- /维基
- 等等...
当我访问该网站时,网址是mysite.org/site或mysite.org/forum。
我想什么太配置我的.htaccess的行为是这样的:
- 网站目录作为根目录:该URL是mysite.org/blabla,但它显示的mysite的内容.ORG /网站/布拉布拉
- 其他目录作为子域:URL是forum.mysite.org但它显示mysite.org/forum
我不能设法得到这个工作.. 。
目前我的.htaccess是这样的:
RewriteEngine On
# Map http://www.example.com to /site.
RewriteRule ^$ /site/ [L]
# Map http://www.example.com/x to /site/x unless there is a x in the web root.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/site/
RewriteRule ^(.*)$ /site/$1
# Add trailing slash to directories without them so DirectoryIndex works.
# This does not expose the internal URL.
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_FILENAME} !/$
RewriteRule ^(.*)$ $1/
# Disable auto-adding slashes to directories without them, since this happens
# after mod_rewrite and exposes the rewritten internal URL, e.g. turning
# http://www.example.com/about into http://www.example.com/site/about
DirectorySlash off
有人可以帮我吗?
不幸的是,我不在专用服务器上,所以我无法更改conf文件。这就是为什么我想通过编辑htaccess来做到这一点。 –