【发布时间】:2015-01-18 21:34:44
【问题描述】:
抱歉我的英语不好下面是我的 htaccess 完整文件我对重写规则了解不多但是如果我在 htaccess 文件中禁用了这一行 (RewriteRule ^([^/]+)/?$ index.php?Page=$1 [L,QSA]),它可以工作,我很困惑?
<IfModule mod_rewrite.c>
# Enable mod_rewrite
RewriteEngine On
# Specify the folder in which the application resides.
# Use / if the application is in the root.
RewriteBase /induspkm
# Rewrite to correct domain to avoid canonicalization problems
# RewriteCond %{HTTP_HOST} !^www\.example\.com
# RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
# Rewrite URLs ending in /index.php or /index.html to /
RewriteCond %{THE_REQUEST} ^GET\ .*/index\.(php|html?)\ HTTP
RewriteRule ^(.*)index\.(php|html?)$ $1 [R=301,L]
#Redirect static pages based on page name
RewriteRule ^([^/]+)/page-([0-9]+)/?$ index.php?Page=$1&PageNo=$2 [L,QSA]
RewriteRule ^([^/]+)/?$ index.php?Page=$1 [L,QSA]
# Rewrite images category pages
RewriteRule ^([^/]+)/.*([0-9]+)/page-([0-9]+)/?$ index.php?Page=$1&ImageCategoryId=$2&PageNo=$3 [L,QSA]
RewriteRule ^([^/]+)/.*([0-9]+)/?$ index.php?Page=$1&ImageCategoryId=$2 [L,QSA]
</IfModule>
# Set the default 500 page for Apache errors
ErrorDocument 500 /induspkm/500.php
#Set the defualt 404 error page
ErrorDocument 404 /induspkm/404.php
【问题讨论】:
-
您好先生,再次感谢您尝试帮助我,我的网站的主管结构是 css、js、business、lib、include,文件是 index.php、admin.php 400.php、500 .php