Apache rewrite rule formatting

komrad's picture

He has: 3 posts

Joined: Jul 2008

Hello all,

I have dynamic pages that look like this.

/index.php?purl=text_variable_with_underscore_2355.html

What would be the rewrite rule to get them to look like this.

/text_variable_with_underscore_2355.html

There is no other page besides index.php for this site.

Thanks

[URL="http://www.website.ws/freedombucks"][B][COLOR="Blue"]Global Domain International - Income For Life[/COLOR][/B][/URL]
[URL="http://www.ultra-internet-income.com"][COLOR="Green"][B]#1 Home Based Business Site[/B][/COLOR][/URL]
[URL="http://www.theSpiderWebSystem.com/komrad"][COLOR="Violet"][B]Spider Web Marketing System[/B][/COLOR][/URL]

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

This should do it:

RewriteRule ^([a-z0-9_]+).html$ index.php?purl=$1.html

I use the mod_rewrite cheat sheet & teammatt3's regular expression tester. They are both very useful tools for getting these expressions right. Smiling

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.