<IfModule mod_rewrite.c>
RewriteEngine On
#The following is the path to be modified in the root directory, such as/laozuo/
RewriteBase /
RewriteCond %{REQUEST_FILENAME} ! -f
RewriteCond %{REQUEST_FILENAME} ! -d
RewriteRule ^(.*)$ /index.php/$1 [L]
#Jump from www to non www
RewriteCond %{HTTP_HOST} ^www.laozuo.org
RewriteRule (.*) http://laozuo.org/ $1 [R=301,L]
#Jump from without www to with www
RewriteCond %{HTTP_HOST} ^laozuo.org
RewriteRule (.*) https://www.laozuo.org/ $1 [R=301,L] </IfModule>
location / {
index index.html index.php;
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php) {
rewrite (.*) $1/index.php;
}
if (!-f $request_filename) {
rewrite (.*) /index.php;
}
}
[ISAPI_Rewrite] # 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
#Chinese tag resolution
RewriteRule /tag/(.*) /index\.php\tag=$1
# sitemapxml
RewriteRule /sitemap.xml /sitemap.xml [L] RewriteRule /favicon.ico /favicon.ico [L] #Content page
RewriteRule /(.*).html /index.php/$1.html [L] #Comments
RewriteRule /(.*)/comment /index.php/$1/comment [L] #Category Page
RewriteRule /category/(.*) /index.php/category/$1 [L] #Pagination
RewriteRule /page/(.*) /index.php/page/$1 [L] #Search Page
RewriteRule /search/(.*) /index.php/search/$1 [L] # feed
RewriteRule /feed/(.*) /index.php/feed/$1 [L] #Date filing
RewriteRule /2(.*) /index.php/2$1 [L] #Upload pictures, etc
RewriteRule /action(.*) /index.php/action$1 [L]