Forum Moderators: phranque

Message Too Old, No Replies

Mod Rewrite Problem

         

pinsharp

11:14 pm on Aug 10, 2005 (gmt 0)



I have set up an .htaccess file with the following:

Options +FollowSymLinks
RewriteEngine on
RewriteRule links(.+)-(.+)-(.+)\.htm$ /lma/directory.php?catid=$1&catname=$2&page=$3 [L]

which should allow directory.php?catid=2&catname=Stamps&page=1 to be called with links2-Stamps-1.htm

This link will not work unless I put a space in the string ie links2-%20Stamps-1.htm the space can be placed anywhere in the string and will work.

An example can be seen here <snip>
If you take out the space it won't work but place a space anywhere within the /links.. section and it works fine.

Any ideas this is driving me mad.

Many thanks
Matt.

[edited by: jdMorgan at 12:05 am (utc) on Aug. 11, 2005]
[edit reason] Removed specifics per TOS. [/edit]

jdMorgan

12:09 am on Aug 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



pinsharp,

Welcome to WebmasterWorld!

The first thing I'd suggest is to flush your browser cache (Temporary Internet Files) before testing any change to your access-control code. Otherwise, your browser will serve cached pages instead of accessing your server. If that happens, then your code can have no effect.

Also, I would suggest you use more-specific regex patterns. This will speed up processing significantly.


RewriteRule ^links([^-]+)-([^-]+)-([^.]+)\.htm$ /lma/directory.php?catid=$1&catname=$2&page=$3 [L]

Links to useful references are posted in our forum charter.

Jim