htaccess rewrite; Should I change all relative links or not?
Posted
by Camran
on Stack Overflow
See other posts from Stack Overflow
or by Camran
Published on 2010-06-08T15:19:24Z
Indexed on
2010/06/08
15:22 UTC
Read the original article
Hit count: 173
I have a rewrite in htaccess which makes this:
domain.com/ad.php?ad_id=bmw_m3_328942948
into this:
domain.com/ads/bmw_m3_328942948
Problem is the links which are relative to the file wont work...
for instance if a link is pointing at '/bin/edit.php' like this originally:
domain.com/bin/edit.php // WORKS
but after the rewrite the link wants to point here instead:
domain.com/ads/bin/edit.php // NOT WORK - NOTE THE /ads/ DOESN'T EXIST IN REALITY
Do you understand my issue?
What is done about this? Do I have to make ALL links using the newer rewritten format?
.htaccess:
Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/ad\.php
RewriteRule ^annons/(.*)$ ad.php?ad_id=$1 [NC,L]
Thanks
© Stack Overflow or respective owner