1

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

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

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

请帮我

4

2 回答 2

1

试试这个:

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

更多参考请点击这里

于 2012-11-09T10:58:55.523 回答
1

尝试编写完整路径:

RewriteEngine On
RewriteBase /filespath/book/
RewriteRule ^([A-Za-z0-9-]+_.)/?$ $1/live/$1.php [NC,L]
于 2012-11-09T11:09:23.837 回答