ranell
ranell

Reputation: 703

htaccess and img path

When i use the following htaccess all is ok with my links

Options +FollowSymlinks
RewriteEngine On

RewriteRule ^auteur\.html$    auteur.php    [L]
RewriteRule ^references\.html$   references.php [L]
RewriteRule ^contact\.html$  contact.php [L]
RewriteRule ^site/actualite\.html$  /site/actualite.php [L]
RewriteRule ^site/actualiteDetail/([0-9]+)/([0-9a-zA-Z_-]+)\.html$  /site/actualiteDetail.php?id=$1&titre=$2    [L]

The only problem is with pictures when i'm on the page mysite.com/site/actualiteDetail/17/titre.html for exemple. The path of my img is :www.mysite.com/pub/img/img.png

How to correct this ? thanks !

Upvotes: 0

Views: 64

Answers (2)

zerokavn
zerokavn

Reputation: 1333

Add to tag: <base href="site_url"/> or you can add / in front of image path.

Upvotes: 0

GuyT
GuyT

Reputation: 4416

Use a slash('/') in front of the path. This is a common .htaccess problem.

Upvotes: 1

Related Questions