-1

我的 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
4

1 回答 1

-1

我从我的网页举一个例子。这是我的.htacces文件,它运行良好。

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -d [OR]    
RewriteCond %{REQUEST_FILENAME} -f 
RewriteRule ^.*$ - [L]

RewriteRule ^desene/categoria-(.*)/(.*)$ index.php?action=selectcategorie&categorie=$1&pag=$2
RewriteRule ^desene/categoria-(.*) index.php?action=selectcategorie&categorie=$1
RewriteRule ^top-desene/categoria-(.*)/(.*)$ index.php?action=top-desene-categoria&categorie=$1&pag=$2
RewriteRule ^top-desene/categoria-(.*) index.php?action=top-desene-categoria&categorie=$1
RewriteRule ^desene/tehnica-(.*)/(.*)$ index.php?action=selecttehnica&tehnica=$1&pag=$2
RewriteRule ^desene/tehnica-(.*) index.php?action=selecttehnica&tehnica=$1
RewriteRule ^top-desene/tehnica-(.*)/(.*)$ index.php?action=top-desene-tehnica&tehnica=$1&pag=$2
RewriteRule ^top-desene/tehnica-(.*) index.php?action=top-desene-tehnica&tehnica=$1
RewriteRule ^contact index.php?action=contact
RewriteRule ^login index.php?action=login
RewriteRule ^desen/(.*)$ index.php?action=desen&iddesen=$1
于 2013-05-26T13:40:09.193 回答