Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 子域文件夹路径重复子域/Subdomain/index.html_Apache_.htaccess_Mobile_Subdomain - Fatal编程技术网

Apache 子域文件夹路径重复子域/Subdomain/index.html

Apache 子域文件夹路径重复子域/Subdomain/index.html,apache,.htaccess,mobile,subdomain,Apache,.htaccess,Mobile,Subdomain,我已经为我的移动站点创建了一个子域,名为m.domain.com,文件夹为/mobile。我面临一个目录配置问题,当我打开m.domain.com时,它显示404未找到错误,路径为mobile/mobile/index.html未找到。我正在为root和mobile文件夹使用两个不同的.htaccess文件。当我从移动文件夹中删除一个.htaccess文件时。它完美地打开了一个索引页面,但其他菜单给出了m.rxcues.com/mobile/menu.html的路径,表示mobile/mobil

我已经为我的移动站点创建了一个子域,名为m.domain.com,文件夹为/mobile。我面临一个目录配置问题,当我打开m.domain.com时,它显示404未找到错误,路径为mobile/mobile/index.html未找到。我正在为root和mobile文件夹使用两个不同的.htaccess文件。当我从移动文件夹中删除一个.htaccess文件时。它完美地打开了一个索引页面,但其他菜单给出了m.rxcues.com/mobile/menu.html的路径,表示mobile/mobile/menu.html,但出现404错误。我需要一个关于如何完美配置htacces的帮助

下面是根目录的htaccess文件

#Options +FollowSymLinks  
Options -MultiViews
RewriteEngine On  
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{HTTP_HOST} www.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

#RewriteRule ^/admin - [L,NC]

RewriteRule index.html templateouter.php
RewriteRule index.php templateouter.php
RewriteRule error.html error.php

#RewriteRule portfolio-([a-z0-9\-]+).html$ portfolio.php?pctid=$1

#RewriteRule ^([a-zA-Z0-9-/]+).html/?$ template.php?url=$1.html&module=$2 [QSA,L]


RewriteRule ^(gallery|hire|quote|pages|staff)/([A-Za-z0-9-]+)/?$ template.php?page=$2&module=$1 [QSA,L]
RewriteRule ^(quote|hire)/?$ template.php?page=$1&module=$1 [QSA,L]

RewriteRule ^([a-zA-Z0-9-/]+).html$ template.php?url=$1.html

RewriteRule ^([a-zA-Z0-9-/]+)/place-(.*) template.php?url=$1.html&place=$2 [QSA,L]

RewriteRule ^([a-zA-Z0-9-/]+)/(.*)/search-(.*) template.php?url=$1.html&id=$2&name=$3 [QSA,L]

RewriteRule ^([a-zA-Z0-9-/]+)/(.*)/(.*)/(.*) template.php?url=$1.html&id=$2&name=$3&other_name=$4 [QSA,L]
这是移动文件夹的htaccess文件

#Options +FollowSymLinks  
Options -MultiViews
RewriteEngine On  
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{HTTP_HOST} www.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

RewriteRule ^/mobile - [L,NC]

RewriteRule index.html template.php
RewriteRule index.php template.php
RewriteRule error.html error.php

RewriteCond %{HTTP_HOST} ^mobile
RewriteCond %{REQUEST_URI} !^/mobile
RewriteRule ^(.*)$ m/$1 [L]


#RewriteRule portfolio-([a-z0-9\-]+).html$ portfolio.php?pctid=$1

#RewriteRule ^([a-zA-Z0-9-/]+).html/?$ template.php?url=$1.html&module=$2 [QSA,L]

RewriteRule ^(gallery|hire|quote|pages|staff)/([A-Za-z0-9-]+)/?$ template.php?page=$2&module=$1 [QSA,L]
RewriteRule ^(quote|hire)/?$ template.php?page=$1&module=$1 [QSA,L]

RewriteRule ^([a-zA-Z0-9-/]+).html$ template.php?url=$1.html

RewriteRule ^([a-zA-Z0-9-/]+)/place-(.*) template.php?url=$1.html&place=$2 [QSA,L]

RewriteRule ^([a-zA-Z0-9-/]+)/(.*)/search-(.*) template.php?url=$1.html&id=$2&name=$3 [QSA,L]

RewriteRule ^([a-zA-Z0-9-/]+)/(.*)/(.*)/(.*) template.php?url=$1.html&id=$2&name=$3&other_name=$4 [QSA,L]

我真的很感激你的帮助

编辑您的问题并放置两个。htaccess我只是使用与移动站点刚刚更改设计相同的htaccess文件。我对htaccess修改不太了解。任何帮助都会对我有所帮助。我在linux托管服务器上托管了我的站点和子域,但我没有在这两个站点中定义virtualhost,因为我根本不知道这些服务器设置和所有设置。请容忍我以适当的方式解决这个问题。我已经定义了$filepath$siteurl$baseurl和所有配置文件最后我解决了这个问题,我刚刚在mobile htaccess中添加了Rewritebase/in,它的工作非常有魅力,感谢anubhava为我们提供的时间和投入