Php htaccess重写以允许新子域。
我有一个我管理的站点,但我从以前的开发人员那里继承了代码。他写了一些重写规则,其中大部分似乎做了必要的工作 但是,我的客户现在购买了一个子域名,例如: 但是,在浏览器中运行此命令只会返回 我已经试着注释出一些规则,试图让商店子域工作,但我似乎做不到 以下是htaccess文件的内容:Php htaccess重写以允许新子域。,php,apache,.htaccess,mod-rewrite,url-rewriting,Php,Apache,.htaccess,Mod Rewrite,Url Rewriting,我有一个我管理的站点,但我从以前的开发人员那里继承了代码。他写了一些重写规则,其中大部分似乎做了必要的工作 但是,我的客户现在购买了一个子域名,例如: 但是,在浏览器中运行此命令只会返回 我已经试着注释出一些规则,试图让商店子域工作,但我似乎做不到 以下是htaccess文件的内容: DirectoryIndex index.php index2.php index.html index.htm # For security reasons, Option followsymlinks cann
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>
我确实对此进行了评论,但没有任何区别,所以现在我也在想,我是否必须处理任何缓存问题 你试过新的浏览器吗?还要检查您的Apache配置是否存在这些规则?@anubhava除了简单地打开htacess文件外,我如何检查配置?首先在Chrome开发工具中打开您的页面,查看您在Net选项卡中获得的重定向。
RewriteRule (.*) index.php [L]