我为移动网站创建了一个子域名,如m.domain.com,文件夹为/ mobile。我正面临一个目录配置问题,因为当我打开m.domain.com时,它显示404未找到路径移动/移动/索引未找到错误。我正在为root用户和移动文件夹使用两个不同的.htaccess文件。当我从移动文件夹中删除一个.htaccess文件时。它完美地打开了一个索引页面但是其他菜单给出了m.rxcues.com/mobile/menu.html的路径,意味着移动/移动/ menu.html有404错误。我需要帮助htacces如何完美配置它?
以下是root
的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]
我非常感谢帮助.. !!