Okey, so this is my problem.
I want to use mod_rewrite to make nice looking urls for my site.
I want them all to have good looking url like http://www.mypage/tennis or http://www.mypage/soccer instead of http://www.mypage/?page=tennis and http://www.mypage/?page=soccer
And with the following rules i can achive this:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule .* index.php [L]
So now if I type in http://www.mypage/soccer my PHP script reads this url and does it’s magic translating this to $_GET[‘page’] = soccer. All this works fine!
Problem is if I would type the URL http://www.mypage/soccer/ all of a sudden every linked css or image cannot be found by the website, since it now looking in the none existing folder /soccer/ off course.
How do I make a rewrite rule that transforms /soccer/ to /soccer or any other /blabla/ to /blabla
Hope my question is clear! Also if anyone have any good pages where I can learn more regular expressions i would be very happy!
Try this: