Rewrtite again...

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

Rewrtite again...

Postby tomwerner » 01. December 2006 23:59

Hi,

I am having some problems getting rewriting working (Apache really hates me with this - I have had so many problems on hosted accounts aswell!).

Anyway - I have uncommented the Loadmodule directive and verified it is loaded using phinfo(). I have also changed AllowOverride to All.

I am trying a really basic rewrite to transform pretty urls into a dynamic urls like so:

RewriteEngine On
RewriteRule ^/products$ ^/content.php
RewriteRule ^/sn2/products/([0-9]+)$ ^/content.php?id=$1

content.php is in the same folder as the .htaccess file, sn2 is a folder directly under apache root.

I get a 404 error when using an internet browser to navigate to http://localhost/sn2/products/9.

Looking in the error log it says:

[Fri Dec 01 22:49:23 2006] [error] [client 127.0.0.1] File does not exist: E:/xampplite/htdocs/sn2/products


Any ideas? Or am i cursed forever?

Cheers - Tom
tomwerner
 
Posts: 2
Joined: 01. December 2006 23:50

Postby Wiedmann » 02. December 2006 00:09

a) RewriteRules (the regex part), used in a ".htaccess", can't start with a slash (/).

b) if you have problems with mod_rewrite, enable the rewrite.log (LogLevel 6) and read it.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Rewrtite again...

Postby Izzy » 02. December 2006 00:17

Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby tomwerner » 02. December 2006 08:47

Cheers people - I walked in blind to that one - just followed a tutorial on it and they used slashes! Took them out and it worked fine - Thanks!!

Cheers for the help,

Tom
tomwerner
 
Posts: 2
Joined: 01. December 2006 23:50


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 121 guests