.htaccess php处理程序modu rewrite

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了.htaccess php处理程序modu rewrite相关的知识,希望对你有一定的参考价值。

This is an .htaccess file for a mod_rewrite php url handler.
  1. #Disables listing of files in directorys
  2. IndexIgnore *
  3.  
  4. #Turns mod_rewrite on
  5. RewriteEngine On
  6.  
  7. #If directory exists ignore RewriteRule
  8. RewriteCond %{REQUEST_FILENAME} !-d
  9.  
  10. #If file exists ignore RewriteRule
  11. RewriteCond %{REQUEST_FILENAME} !-f
  12.  
  13. #If link exists ignore RewriteRule
  14. RewriteCond %{REQUEST_FILENAME} !-l
  15.  
  16. #Rewrite url and pass to variable $url(in php script use $_REQUEST['url']
  17. #then write url handler to parse url in index.php)
  18. RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

以上是关于.htaccess php处理程序modu rewrite的主要内容,如果未能解决你的问题,请参考以下文章

.htaccess从modu rewrite中排除目录

php重写路由

.htaccess 文件的位置

httpd.conf .htaccess

删除 index.php 后找不到页面

用modu重写处理可选参数