Jump to content

.htaccess - mod_rewrite and my images


glenelkins

Recommended Posts

Hi

My .htaccess file:
[code]
RewriteEngine On
Options +FollowSymlinks
RewriteBase /books/
RewriteRule ^(.*)/(.*)$ search.php?format=$1&isbn=$2
[/code]

Now this works fine to enable urls such as: http://localhost/books/format/isbn_number

But, the initial file is "index.html" , there is a logo on this page with the file src as: "images/logo.jpg"

When the page loads up, the logo image does not display. I look at the source and its pointing to the correct place, i even tried changing the src to "/images/logo.jpg" and "http://localhost/books/images/logo.jpg" and "/books/images/logo.jpg"

None of these work, why are my images vanishing? I have seen a few posts around stating to include the full path to the image in the HTML document but as I just explained this does not work

localhost/books/

Link to comment
https://forums.phpfreaks.com/topic/28632-htaccess-mod_rewrite-and-my-images/
Share on other sites

  • 3 months later...
Hi [b]glenelkins[/b]

if you still have problem,this is the solution

[b]RewriteEngine On
RewriteBase /
[b]RewriteRule ^prefabrik/images/(.*)$  images/$1[/b]
RewriteRule ^prefabrik/(.*).html      index.php?id=$1[/b]

and if you use two variables solution changes like that,

[b]RewriteEngine On
RewriteBase /
RewriteRule ^prefabrik/tekkat/images/(.*)$  images/$1
RewriteRule ^prefabrik/tekkat/(.*).html      /index.php?id=26&pl=$1[/b]

take care,bye :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.