我到处看看网上的教程htaccess的都是非常基本的。他们没有解释什么从哪里获得advenaced htaccess的turorials
RewriteCond %{HTTP_HOST} ^www\.mysite\.com$ [NC]
RewriteRule ^(.*)$ http://mysite.com/$1 [R=301,L]
[NC]
和[R=301,L]
平均(我可以计算的301 REDIR寿)
而且哪里的%{HTTP_HOST}
令牌进来吗?还有其他什么?什么时候捕获了$1
? ...
是否有解释这一切的任何教程?
编辑:下面是我的mguymon htaccess文件:
Options -Indexes
ErrorDocument 404 /404.php
CheckSpelling on
RewriteEngine On
RewriteBase/
###### Check for alias module to be installed ######
###### Domain without www ######
RewriteCond %{HTTP_HOST} ^www\.mysite\.com$ [NC]
RewriteRule ^(.*)$ http://mysite.com/$1 [R=301,L]
###### End www rewrite section ######
# Remove multiple slashes anywhere in URL
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
# Remove multiple slashes after domain
RewriteCond %{HTTP_HOST} !=""
RewriteCond %{THE_REQUEST} ^[A-Z]+\s//+(.*)\sHTTP/[0-9.]+$
RewriteRule .* http://%{HTTP_HOST}/%1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]
# show mysite.com/index.php always as mysite.com/
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://mysite.com/ [R=301,L]
这将改变www.mysite.com/index.php/////index.php
到mysite.com
这是每一个与他们[L]
开关
教程不是参考。 http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html – 2012-03-20 01:24:07