Gossamer Forum
Home : General : Internet Technologies :

mod_rewrite - :/

Quote Reply
mod_rewrite - :/
Hi,

I've got the following mod_rewrite code;

Code:
RewriteEngine On
RewriteRule ^index.html index.php [L]
RewriteRule ^article(\d+).html$ modules.php?name=News&file=article&sid=$1 [L]
RewriteRule ^(.*).mod$ modules.php?name=$1 [L]

The first and last one's work fine, but the second one just doesn't seem to be making a match.

Example call: article1.html , which *should* convert to modules.php?name=News&file=article&sid=1

Any ideas?

TIA

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] mod_rewrite - :/ In reply to
Doh... just had a stupid 10 mins <G>

It should have been;

RewriteRule ^article([0-9]+).html$ modules.php?name=News&file=article&sid=$1 [L]

..and not;

RewriteRule ^article(\d+).html$ modules.php?name=News&file=article&sid=$1 [L]

..which is the Perl regex version <G>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!