Help with redirecting URL's

Using mod_rewrite to handle various content issues

Help with redirecting URL's

Postby stewrat » Sat Jul 22, 2006 8:45 am

I am unable to edit the file that includes the links as it is encrypted using ionCube, so I wanted to use mod rewrite to redirect these links to new static pages.

For example, I want to redirect a link for URL: - ... properties
to -

and I want to redirect a link for URL: - ... membership
to -

I have had success with simple redirects, but hit a problem when the 'from' link includes some variables.

Any help would be appreciated.


Posts: 1
Joined: Sat Jul 22, 2006 8:13 am
Location: Erith, UK

Postby richardk » Sat Jul 22, 2006 2:31 pm

You really shouldn't do that, it's a lot more work for the server, maybe you could ask them to make the changes and give you a new encrypted file.

Assuming your using a .htaccess file in your root directory:
Code: Select all
# /villas/index.php?user=listproperties --> /villas/properties.php
RewriteCond %{QUERY_STRING} ^user=listproperties$
RewriteRule ^villas/index\.php$ /villas/properties.php? [R=301,L]

Code: Select all
# /villas/index.php?user=membership --> /villas/members.php
RewriteCond %{QUERY_STRING} ^user=membership$
RewriteRule ^villas/index\.php$ /villas/members.php? [R=301,L]
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Return to Content

Who is online

Users browsing this forum: No registered users and 2 guests