我的 htaccess 有许多重写规则,由于某种原因不会重写/工作:
示例上下文:当您去注册时,您单击注册,然后单击提交,它会将您带到链接:www.sanchexpaycut.com/home
规则:
RewriteRule ^([a-zA-Z0-9_-]{3,30})/?$ index.php?page=$1 [L]
规则将/应该输出什么:http ://sanchezpaycut.com/index.php?page=home
会发生什么:404 未找到错误
带有错误日志:[Sun May 26 09:10:20 2013] [error] [client 24.91.118.174] 文件不存在:/var/www/vhosts/patmccoy.me/sanchez/home,引用者:http:// sanchezpaycut.com/
对名称底部的页面也做同样的事情:
链接:http://sanchezpaycut[dot]com/page_2#listing 规则:RewriteRule ^([a-zA-Z0-9_-]{3,30})/?$ index.php?page=$1 [L]
会发生什么:http://sanchezpaycut[dot]com/index.php?page=page_2#listing 会发生什么:404
任何帮助都会很棒谢谢
服务器信息:mediatemple dv - mod rewrite 已检查并正确安装
.htaccess 文件
RewriteEngine On
DirectoryIndex index.php
RewriteRule ^([a-zA-Z0-9_-]{3,30})/([^/]+)/([^/]+)?$ index.php?page=$1&s=$2&o=$3 [L]
RewriteRule ^([a-zA-Z0-9_-]{3,30})/([^/]+)/([a-zA-Z0-9_]+)/([^/]+)?$ index.php?page=$1&s=$2&o=$3&p=$4 [L]
RewriteRule ^([a-zA-Z0-9_-]{3,30})/([^/]+)/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([^/]+)?$ index.php?page=$1&s=$2&o=$3&p=$4&q=$5 [L]
RewriteRule ^([a-zA-Z0-9_-]{3,30})/([^/]+)/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-zA-Z0-9]+)/([^/]+)?$ index.php?page=$1&s=$2&o=$3&p=$4&q=$5&r=$6 [L]
RewriteRule ^([a-zA-Z0-9_-]{3,30})/([^/]+)?$ index.php?page=$1&s=$2 [L]
RewriteRule ^([a-zA-Z0-9_-]{3,30})/?$ index.php?page=$1 [L]
RewriteRule ^([a-zA-Z0-9_-]{3,30})?$ index.php?page=$1 [L]
ErrorDocument 404 /404