Forum Moderators: phranque

Message Too Old, No Replies

Lost Images - URL Rewriting

         

zmroberts

10:40 pm on Jul 27, 2005 (gmt 0)

10+ Year Member



All... here is my htaccess file...

RewriteEngine on
RewriteRule ^(.*)$ productpage.php?product=$1

It works great when i type in www.mydomain.com/myProduct ... but ... all my images are not getting picked up and the css file is not getting picked up anymore. Why is that?

Thanks for the help.

zmroberts

12:07 am on Jul 28, 2005 (gmt 0)

10+ Year Member



ok this is interesting... I changed the .htacces slightly and now it is including the images but not the .css file...

here is the new version...

RewriteEngine on
RewriteRule ^(.*).htm$ productpage.php?product=$1

then I access the page like this...
www.mydomain.com/myProduct.htm which produces the page...

www.mydomain.com/productpage.php?product=myProduct

Can anyone help get the .css file working?

Thanks

zmroberts

12:09 am on Jul 28, 2005 (gmt 0)

10+ Year Member



hmmm... strange now is seems to be working fine for both the css and images... I have no idea why... I am still using the second version of the .htaccess file.

Thanks for the help! ;->

zmroberts

10:17 pm on Jul 28, 2005 (gmt 0)

10+ Year Member



I say screw it ... if google is OK with the query string ... then I am ok with the query string. this rewriting garbage adds too many complications.

jdMorgan

3:14 am on Jul 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I wonder if you flushed your browser cache before testing your changes...

Your server will do exactly what you tell it to do, no more, no less. Please don't blame the tools.

Your code will be better-behaved and faster with a few tweaks:


RewriteEngine on
RewriteRule ^([^.]+)\.htm$ productpage.php?product=$1 [L]

If you change the code, flush your browser cache before testing.

Jim