繁体   English   中英

重写规则在 .htaccess 文件中不起作用

[英]rewrite rule is not working in .htaccess file

在我的门户中,我调用了一个 pdf 文件,路径看起来像http://www.mysite.com/filespath/books/online_bliss_in_five_simple_steps_1339668056/live/online_dating_bliss_in_five_simple_steps_1339668056.php

为了用户接受,我需要减少这个网址。 然后我在 .htaccess 文件中添加一个代码。 添加此行后,当我调用我的门户时,仅显示一个白页,代码为

RewriteEngine On
RewriteRule    ^book/([A-Za-z0-9-]+_.)/?$  /live/$1.php    [NC,L]

请帮我

尝试这个:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.askapache\.com$ [NC]
RewriteRule ^(.*)$ http://www.askapache.com/$1 [R=301,L]

更多参考请点击 这里

尝试编写完整路径:

RewriteEngine On
RewriteBase /filespath/book/
RewriteRule ^([A-Za-z0-9-]+_.)/?$ $1/live/$1.php [NC,L]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM