簡體   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