I'm busy to create a standard template for myself that i want to use with all the websites i make. And i want to use Mod_Rewrite to create "clean" URL's.
The pages that i want to catch are like "index.php?page=home". And i want to create something like "mainFolder/page/home", now it looks so much better. I never really worked with Mod_Rewrite but this is what i at first came up with:
- Code: Select all
RewriteEngine on
RewriteRule ^page/([^/\.]+)/?$ index.php?p=$1 [L]
Now i have this:
- Code: Select all
Options +FollowSymLinks
RewriteEngine on
RewriteBase /cms/
RewriteRule ^page/([^/]+) /cms/index.php?p=$1
In the menu i have the links like this:
- Code: Select all
<a href="page/home">Home</a>
The rewriting actually works becouse i get my Index.php and the home page included. But everytime i click a link, the CSS leaves.
That was problem one, now for problem 2. When i click the link, my url is this: cms/page/home, and it includes home. But when i click it twice, or thrice, it gets: cms/page/page/page/home and it tries to include "page" not "home".
How can i fix this? thx in adv.