I’m a total noob when it comes to modrewrite and I wrote the following rewrite rule in my .htaccess file:
RewriteRule ^([^/]*)/([^/]*)$ teams.php?team=$1&year=$2 [L]
That rule effectively makes a link like
teams.php?team=Cincinnati Reds&year=2012
Become
/Cininnati Reds/2012
But the css file wont load. I tried changing
<link rel="stylesheet" type="text/css" href="css/conceptually.css" />
to
<link rel="stylesheet" type="text/css" href="../css/conceptually.css" />
With no luck.
Any ideas about how to make any quick rewrite rules that I would write so that I don’t have to to into each file and change the directory to each CSS file.
EDIT:
Actually, I would ideally like the URL to be teams/Cincinnati Reds/2012 and not just /Cincinnati Reds/2012. Is it possible to do that?
I use the following two rewrite-conditions to not use rewriting for all real files and directories:
Btw. with mod_rewrite, you rewrite a URL from
/Cininnati Reds/2012toteams.php?team=Cincinnati Reds&year=2012. mod_rewrite does not turn your links into that format. That is left to the displaying application.