Page 1 of 1

URL Rewriting in htacess

Posted: Tue Jun 07, 2005 9:08 am
by mzfp2
Hi,

I have been using a rewrite conditon for in my htaccess file for some time now, the condition simply takes a url such as http://alljammin.com/username and translates it to a real url which a script can process.

The code in my htaccess file is as below

Code: Select all

RewriteEngine On
RewriteCond %{REQUEST_URI} !index.php
RewriteRule ^(їa-zA-Z0-9_]+)/?$ db/interface/profiles.php?Action=view&username=$1 їNC,L]


However, I now want add a new rule, which im having trouble doing. I need to translate a url such as

http://alljammin.com/forums/101
to
http://alljammin.com/forums.php?forum_id=101

I have tried tweaking the Rewrite rules I am already using, but not having any success, anyone who can help would be a star.

Thanks
Mzfp

Posted: Tue Jun 07, 2005 9:19 am
by John Cartwright

Code: Select all

RewriteRule ^(їa-zA-Z]+)/(ї0-9]+)?$ /($1).php?forum_id=$2
What about this?

Posted: Tue Jun 07, 2005 9:33 am
by mzfp2
Hi

Thanks for your reply, it was very helpful, i used your code with slight changes and solved the problem!

Many thanks once again

Kind Regards
mzfp