如何更改.htaccess以允许访问多个页面

如何更改.htaccess以允许访问多个页面,.htaccess,subdomain,.htaccess,Subdomain,我接管了一个朋友的托管帐户,在他的服务器上托管第二个域。除了由设计第一个站点的人生成的.htaccess文件之外,一切都很好 主站点是:ra-pictures.com,托管在根文件夹中/ 我正在使用的网站是posthumanimovie.com,它位于/posthuman文件夹中 以下是当前的.htaccess文件: <IfModule mod_rewrite.c> RewriteEngine on # route non-existant requests to

我接管了一个朋友的托管帐户,在他的服务器上托管第二个域。除了由设计第一个站点的人生成的.htaccess文件之外,一切都很好

主站点是:ra-pictures.com,托管在根文件夹中/

我正在使用的网站是posthumanimovie.com,它位于/posthuman文件夹中

以下是当前的.htaccess文件:

<IfModule mod_rewrite.c>
    RewriteEngine on

    # route non-existant requests to single script
    RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} !-f
    RewriteRule ^.*$ index.php [QSA,NS]

</IfModule>

重新启动发动机
#将不存在的请求路由到单个脚本
重写cond%{DOCUMENT\u ROOT}/%{REQUEST\u URI}-F
重写规则^.*$index.php[QSA,NS]
当我尝试去posthumanmovie.com时,我得到一个404未找到错误


当我删除.htaccess文件时,它可以工作,但他的另一个网站ra-pictures.com在任何非索引页的页面上都有404个错误。关于如何更改.htaccess文件以允许访问两个站点的所有页面,有什么想法吗?

添加一个条件以检查主机名:

<IfModule mod_rewrite.c>
    RewriteEngine on

    RewriteCond %{HTTP_HOST} ra-pictures\.com$ [NC]
    # route non-existant requests to single script
    RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} !-f
    RewriteRule ^.*$ index.php [QSA,NS]

</IfModule>

重新启动发动机
RewriteCond%{HTTP_HOST}ra pictures\.com$[NC]
#将不存在的请求路由到单个脚本
重写cond%{DOCUMENT\u ROOT}/%{REQUEST\u URI}-F
重写规则^.*$index.php[QSA,NS]