Regex and mod_rewrite woes

New to mod_rewrite? This is a good place to start.

Postby anithri » Thu Sep 06, 2001 2:26 pm

I'm going to be using mod_rewrite to turn from /somepage.html to /myscript.php?somepage.html

This I figured out how to do.

The catch is I don't want /somedir/somepage.html to go to the script, I want it to get the page as normal.

I've tried a number of things like.
RewriteRule /([^/]*).html$ test.php?$1 [L]
and
RewriteRule [^/]([[:alnum:]-_]+).html$ test.php?$1 [L]

when either of these used I get the results.
http://mydomain.com/abc.html -> does test.php
http://mydomain.com/garbage/abc.html -> does test.php

I'm at wits end. can anyone point me in the right direction?

<font size=-1>[ This Message was edited by: anithri on 2001-09-06 18:26 ]</font>
anithri
 
Posts: 1
Joined: Wed Sep 05, 2001 4:00 pm

Postby Brett » Wed Sep 26, 2001 12:09 pm

Try adding something like this before your RewriteRule statement:
RewriteCond %{REQUEST_URI} !^/.*/
Brett
 
Posts: 82
Joined: Tue Jul 10, 2001 4:00 pm
Location: yohost.com


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 27 guests

cron