deepu sankar
deepu sankar

Reputation: 4465

rewrite rule is not working in .htaccess file

in my portal i call a pdf file, path looks like http://www.mysite.com/filespath/books/online_bliss_in_five_simple_steps_1339668056/live/online_dating_bliss_in_five_simple_steps_1339668056.php

for user acceptance i need to reduce this url. then i add a code in .htaccess file. after adding this line only a white page is displaying when i call my portal the code is

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

please help me

Upvotes: 1

Views: 106

Answers (2)

Korikulum
Korikulum

Reputation: 2619

Try writing the full path:

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

Upvotes: 1

Kichu
Kichu

Reputation: 3267

Try this:

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

For more reference click Here

Upvotes: 1

Related Questions