rewriting to phpbb directory ...

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

rewriting to phpbb directory ...

Postby Jackson09 » Mon Sep 07, 2009 11:00 pm

Hi there,

Hoping someone can help, I've been struggling with the following for days now. Here is what I have so far:

Here is my link:
http://www.mysite.com/my-forum

I need it so that when a user click on the above link, then they are redirected to the following url:
http://www.mysite.com/my-forum/viewforum.php?f=1

Here is my rewrite attempt:
RewriteRule ^my-forum$ http://www.mysite.com/my-forum/viewforum.php?f=1

At the moment, when i click on the link, it sends me (incorrectly) to:
http://www.mysite.com/my-forum/?f=1

Can anyone help please?
Thanks!
Jackson09
 
Posts: 2
Joined: Mon Sep 07, 2009 10:50 pm

Postby richardk » Tue Sep 08, 2009 7:54 am

Because /my-forum gets redirected to /my-forum/.

Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^my-forum$  /my-forum/ [R=301,L]
RewriteRule ^my-forum/$ /my-forum/viewforum.php?f=1 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Jackson09 » Tue Sep 08, 2009 3:36 pm

Thanks Richard !!!!!!!!!!

Perfect !

Spot-On !

Thanks mate, your a champion !

:wink:
Jackson09
 
Posts: 2
Joined: Mon Sep 07, 2009 10:50 pm


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 27 guests

cron