子文件夹的htaccess重写规则

时间:2012-01-12 15:06:17

标签: .htaccess rewrite subdirectory

  

可能重复:
  .htaccess for subfolder

我的网站结构是

-www   -subfolder 在www我有我的主站点的index.php。

在子文件夹中,我有一种管理界面,在那里我有另一个用于管理界面的index.php。

目前,来自/subfolder/index.php的请求被重定向到www / index.php,基本上我的管理界面的页面都没有出现。

这是www文件夹中的.htaccess文件:

DirectoryIndex index.php

RewriteEngine On
RewriteRule ^$ index.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/(.*)$ index.php?lang=$1&page=$2 [L]

对于主站点,我有网址结构:www.domainname.com/lang/page例如www.domainname.com/en/home

对于子文件夹中的管理员网站,我有网址结构www.domainname.com/subfolder/page

如何显示子文件夹中的页面?我是否需要在子文件夹中使用另一个htaccess?有什么内容?请帮我解决一下。我尝试了其他答案中列出的许多例子都无济于事。它将为我节省大量工作!

0 个答案:

没有答案