Redirect using Variables (RewriteEngine)

Hello so I’m new to this mod_rewrite stuff.

This is probably very basic, but how do I make it so if someone enters:
http://mysite.com/user/<whatever>
to
http://mysite.com/forum/memberlist.php?username=<whatever above>&otheroption=5
I tried somewhat, but I have no clue what I’m doing.

Thanks ~ Jackz

1 Like

Hi jackz,

That does not look like a difficult problem but, if you don’t show your code (and can find the answers in a tutorial with many sample problem codes explained at http://dk.co.nz), it’s best to wait for you to (A) show your code and (B) learn just a bit about mod_rewrite.

Regards,

DK

Okay, well I haven’t found a site that explains it in a way I understand but I’ll check that site.
I tried like generators to see if they could help but no luck.

Okay so I read through that. So I need code somewhat like this:
RewriteEngine on
RewriteCond %{REQUEST_URI} /user
RewriteRule ?? http://example.net/forum/memberlist.php?username=$&perpage=20&username_match=begins&sort=regdate

I don’t understand for the RewriteRule what to do, to match example.com/user/ only (Not /c/user/etc)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.