Mod_Rewrite style leaves

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Mod_Rewrite style leaves

Postby onceuponatim » 20. February 2012 14:59

Hello everybody,

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. ;)
onceuponatim
 
Posts: 1
Joined: 20. February 2012 14:07
Operating System: Windows 7, Arch-Linux

Re: Mod_Rewrite style leaves

Postby JonB » 23. February 2012 15:29

my 'offhand' guess would be that you need absolute URL's in the CSS includes.

AND

relative references when not referencing an object/resource.

Good Luck
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 204 guests