views:

35

answers:

2

Hi, In order to make nice and friendly SEO links I'm using this:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)\.html$ page.php?ida=$1&idb=$2 [QSA]

So http://www.example.com/solutions/hardware.html will be: http://www.example.com/page.php?ida=solutions&idb=hardware

This works.

But the problem is there is no graphic element downloaded! (Inline images and css background), The font style and none graphic style applied well since the css style section is not in a separate css file but it's embeded in my header section page.

Is there any helpful lines to be added in my .htaccess file so therefore images/ directory would be axcepted?

Help please i'm new in .htaccess!

Thanks,

A: 

Try:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)\.html$ page.php?ida=$1&idb=$2 [QSA]
Sam Dark
This way you will exclude real existing files from next matches.
Sam Dark
Tried, but unfortunately i've encountered the same issue;
Mbarry
+2  A: 

Relative URLs are now resolved from /solutions/hardware.html and not /page.php?ida=solutions&idb=hardware. That means a reference with a relative URL path like images/foobar would be resolved to /solutions/images/foobar and not to /images/foobar.

Just use absolute URL paths like /images/foobar to reference your external resources and the references are independent from the path of your base URL.

Gumbo
Ok, you mean i have to use:<link rel="stylesheet" href="http://www.site.com/style/css.css"/>Instead of <link rel="stylesheet" href="style/css.css"/>
Mbarry
Working well!Thank you
Mbarry
@Mbarry: You don’t need to use an absolute URL. You can also use a relative URL with just an absolute path like `/style/css.css`.
Gumbo