Forum Moderators: phranque

Message Too Old, No Replies

Simple redirect of a php page

         

mdesign

5:06 pm on Jul 1, 2007 (gmt 0)

10+ Year Member



Hi all,
I have a site with this structure:

Root
¦--> Blog
¦--> Forum

Root, blog and forum have htaccess files with specific rules.

I would redirect the forum registration page to the blog registration.
I have tried some rules but I can't have the result I want. For example:

in the Forum htaccess:

Redirect 301 /index.php?action=register http://www.site.it/blog/index.php?option=com_registration&task=register [L] 

or, in the Root htaccess,

RewriteRule ^forum/index.php?action=register$ http://www.site.it/blog/index.php?option=com_registration&task=register [R=301,L] 

This rules have not effect.

Any idea?

Tnx,
Mario

jdMorgan

6:30 pm on Jul 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Query strings are not visible to mod_alias directives, and they must be handled separately in mod_rewrite:

In the Forum htaccess:


Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{QUERY_STRING} ^action=register$
RewriteRule ^index\.php$ http://www.example.it/blog/index.php?option=com_registration&task=register [R=301,L]

Jim

mdesign

7:34 pm on Jul 3, 2007 (gmt 0)

10+ Year Member



Thank you Jim!