Zen Cart Logo
Forums / General Questions / Need Page redirect (mo_rewrite) htaccess due to URL change

Need Page redirect (mo_rewrite) htaccess due to URL change

Locked

Views: 1,543

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
15 Jul 2007, 12:48 PM
#1
tomcz avatar

tomcz

New Zenner

Join Date:
Feb 2007
Location:
Prague
Posts:
53
Plugin Contributions:
0

Need Page redirect (mo_rewrite) htaccess due to URL change

Hi, my web address was changed and now I use this to redirect visitors from the old address to the new address via .htaccess.

RewriteEngine on
RedirectMatch 301 ^(.*)$ http://www.rcshop.eu

I would like to ask you, if someone knows if it is possible to redirect all address like this:

http://www.rctomik.eu/rc-vrtulniky-c-131.html

to

http://www.rcshop.eu/rc-vrtulniky-c-131.html

becauce my solution redirect this address http://www.rctomik.eu/rc-vrtulniky-c-131.html only to http://www.rcshop.eu

I would like to do dthis because of addresses indexed by google and other search engines.

18 Jul 2007, 7:42 PM
#2
brandtim avatar

brandtim

Zen Follower

Join Date:
Apr 2006
Posts:
250
Plugin Contributions:
0

Re: Need Page redirect (mo_rewrite) htaccess due to URL change

From the Apache guide to mod_rewrite:

http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html

Your .htaccess file should look roughly like this:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.rctomik.eu$ [NC]
RewriteRule ^(.*)$ http://www.rcshop.eu/$1 [R=301,L]

BrandTim

18 Jul 2007, 8:01 PM
#3
tomcz avatar

tomcz

New Zenner

Join Date:
Feb 2007
Location:
Prague
Posts:
53
Plugin Contributions:
0

Re: Need Page redirect (mo_rewrite) htaccess due to URL change

I have got this:

RewriteEngine on
RedirectMatch 301 ^/(.*)$ http://www.rcshop.eu/$1

It works but I am not sure about the code 301, if it si OK.