Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache htaccess文件的干净url_Apache_.htaccess - Fatal编程技术网

Apache htaccess文件的干净url

Apache htaccess文件的干净url,apache,.htaccess,Apache,.htaccess,我试图将我的用户重定向到一个具有干净url的特定页面,我设法对一个url执行此操作,但当我尝试第二个url时,它只会将我发送到原始url (请求url)/page/mail(真实url)/content/mail.php 我有什么办法可以做到这一点吗 我的代码: RewriteEngine On RewriteRule ^page content/index.php (works) RewriteRule ^page/mail content/mail.php (not worki

我试图将我的用户重定向到一个具有干净url的特定页面,我设法对一个url执行此操作,但当我尝试第二个url时,它只会将我发送到原始url

(请求url)
/page/mail
(真实url)
/content/mail.php

我有什么办法可以做到这一点吗

我的代码:

RewriteEngine On
RewriteRule ^page       content/index.php (works)
RewriteRule ^page/mail  content/mail.php (not working)

尝试重新安排您的规则--例如将^page/mail置于^pageRewrite之前。重写规则高度依赖于顺序。翻转订单,或使用
$
终止订单,如
重写规则^page$…
中所述,以确保第一个订单与第二个订单不匹配。@MichaelBerkowski谢谢!为我工作