我有一个我管理的网站,但我继承了之前开发人员的代码。他写了一些重写规则,其中大部分似乎都做了必要的工作。
但是我的客户现在购买了一个子域名,例如:http://shop.thesite.com
但是,在浏览器中运行此功能只会返回http://thesite.com
我已尝试评论一些规则,试图让商店子域工作,但我似乎无法做到这一点。
以下是htaccess文件的内容:
DirectoryIndex index.php index2.php index.html index.htm
# For security reasons, Option followsymlinks cannot be overridden.
#Options +FollowSymLinks
Options +SymLinksIfOwnerMatch
RewriteEngine On
########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.xml|\.feed|\.ajax|\.img|\.xhtml|/[^.]*)$ [NC]
RewriteRule (.*) index.php [L]
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
<Files *.inc.php>
order allow,deny
deny from all
</Files>
<Files pagecounter.inc.php>
order allow,deny
allow from all
</Files>
<IfModule mod_php5.c>
php_value upload_max_filesize 50M
</IfModule>
<IfModule mod_php4.c>
php_value upload_max_filesize 50M
</IfModule>
我意识到这是很多代码,这可能不是最开明的问题,但我会感激一些帮助。
这是我认为重写子域的行:
RewriteRule (.*) index.php [L]
我做了评论,但它没有任何区别,所以现在我也想知道我是否需要处理任何缓存问题。