links and images in rewrited page

New to mod_rewrite? This is a good place to start.

links and images in rewrited page

Postby dstonek » Fri Sep 05, 2003 5:55 am

RewriteRule ^page1\.php/var1=(.*)$ _page1.php?var1=$1 [L]

mydomain.com/page1.php/var1=sth is rewrited as mydomain.com/page1.php?var1=sth

The problem is that all links and images sources in page1.php are modified.
Example: an image source image.jpg (under mydomain.com) is rewrited as mydomain.com/page1.php/image.jpg instead of mydomain.com/image.jpg

How may I correct the Rule?
thank you in advance
dstonek
 

Postby aaroncimolini » Sat Sep 06, 2003 12:26 am

is this the only rewrite rule you are using? are there others? It looks to me like that rule would not match your image files.

have you set the RewriteBase to be '/page1.php'?

Aaron
User avatar
aaroncimolini
 
Posts: 5
Joined: Thu Sep 04, 2003 12:14 am

Postby dstonek@adinet » Sat Sep 06, 2003 7:00 pm

RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^\.htaccess$ - [F]

and one line for that rule.
I´ve "fixed" the problem by adding "../" or "http://....." before the image source and the hrefs.
It is not elegant but it´s working

Thank you Aaron,
Daniel
dstonek@adinet
 


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 23 guests

cron