.htaccess seo urls
Hi guys.. wonder if you can help with a small problem i've got.
I've used the following .htaccess code to get nice seo style urls for a site I'm developing.
<?php
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)/(.*)/ /index.php?lang=$1&page=$2
?>
Which works great.. except now my internal links to images, css, js etc don't work. Can anyone tell me how I would add in some lines that would make those filetypes exceptions to the above rule?
timjpriebe posted this at 16:40 — 20th March 2007.
He has: 2,667 posts
Joined: Dec 2004
You might actually do the URLs like lang/english/2
Then the htaccess rewrite rule would look like
RewriteRule ^(lang)/(.*)/(.*)/ /index.php?lang=$2&page=$3
That way, anything not in that non-existent lang folder (ie images and css) would work fine.
Tim
http://www.tandswebdesign.com
Snetty posted this at 16:41 — 20th March 2007.
They have: 3 posts
Joined: Oct 2005
actually just figured this out.. but thanks anyway.
edit - it was my urls (and my understanding) that was wrong..
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.