Jump to content

[Solved] Redirect to new domain, keep access to old shop


CrossY

Recommended Posts

Hi there,

 

I've recently moved a shop from www.domain1.com to www.domain2.com, and used a 301 redirect to do so.

 

However, the old shop is still running (maintenance mode) on wwww.domain1.com.

 

Is there a way to keep access to my old shop just for me?

 

I've tried two things in the following code:

1. Exclude the /admin1 path from the redirect (not ideal, I want to be able to see the shop as well)

2. Exclude my IP from the redirect -- that doesnt seem to work

Options +FollowSymlinks
RewriteEngine on

#urls to exclude
RewriteCond %{REQUEST_URI} !/admin1$

#ip to allow access
RewriteCond %{REMOTE_HOST} !^11\.11\.11\.11$

#send to root
RewriteRule .? http://www.domain2.com [R=301,L]

Any ideas on how to do this?

 

Regards,

Dave

Edited by CrossY (see edit history)
Link to comment
Share on other sites

Solved, i think :)

 

 

<IfModule mod_rewrite.c>

Options +FollowSymlinks
RewriteEngine on
 
#urls to exclude
RewriteCond %{REQUEST_URI} !/admin1$
 
#ip to allow access
RewriteCond %{REMOTE_ADDR} !=11.11.11.11
 
#send to root
RewriteRule .? http://www.domain2.com [R=301,L]
 
</IfModule>

 

This seems to work. Enabled maintenance with IP filter.

 

Works when people land on some random page (old product) of your shop as well. Tested with mobile and proxy (for the IP thingy).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...