htaccess rewrite; Should I change all relative links or not?
- by Camran
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