.htaccess 坚持用mod_重写
以下是我的问题的基本解释: 我需要从.htaccess 坚持用mod_重写,.htaccess,mod-rewrite,.htaccess,Mod Rewrite,以下是我的问题的基本解释: 我需要从http://domain.com/file.php?name=xxxx 到http://domain.com/xxxx 所以,问题是:我有一些目录,如images、css、include等,其中存储文件,而不是重写为http://domain.com/xxxx将进入目录本身。 这是我的废弃.htaccess文件: RewriteEngine On RewriteRule ^index.html$ index.php [QSA,L] Rewr
http://domain.com/file.php?name=xxxx
到<代码>http://domain.com/xxxx
所以,问题是:我有一些目录,如images、css、include等,其中存储文件,而不是重写为http://domain.com/xxxx
将进入目录本身。
这是我的废弃.htaccess
文件:
RewriteEngine On
RewriteRule ^index.html$ index.php [QSA,L]
RewriteRule ^help.html$ help.php [QSA,L]
RewriteRule ^([^/]+)\.xml$ info.php?id=$1 [QSA,L]
RewriteRule ^(\w+)$ file.php?name=$1 [L]
您知道如何修复它,并允许我在该目录中存储的文件继续工作吗?您可以在文件中设置标记,然后它将知道相对应的位置,或者您可以使用完整路径。这里有一条重写规则,如果文件实际上不存在于该位置,它会将所有请求重定向到页面处理程序:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ path/to/pagehandler.php?page=$1 [QSA]
还是没有重写,有什么想法吗?