Forum Topic: Building a new eccomerce site while the old static HTML site is still live?

Forum: .htaccess Forum : Redirecting • Posted by Joseph Shrock • Updated:

I am having some redirect frustrations!

We are ready to revamp a number of eCommerce sites with shopping cart software and want to install and develop them directly in the root folder so would need to have all the current traffic (except our IPs) redirected from the [public_html] folder to the oldsite folder where the old webpages are going to temporarily reside while we work on the new site, for demo purposes we started with a small site:

[kitchencookstoves.com] with the below scripts but were either having issues with loops back into the root folder or the /oldsite/ showing in our url, etc;

RewriteCond %{HTTP_HOST} ^(www.)?kitchencookstoves.com$
RewriteCond %{REQUEST_URI} !^/oldsite/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /oldsite/$1
RewriteCond %{REMOTE_HOST} !^139\.55\.34.143
RewriteCond %{HTTP_HOST} ^(www.)?kitchencookstoves.com$
RewriteRule ^(/)?$ oldsite/index.php [L]

-or-

RewriteCond %{HTTP_HOST} ^www.kitchencookstoves.com$ [OR]
RewriteCond %{HTTP_HOST} ^kitchencookstoves.com$
RewriteCond %{REMOTE_HOST} !^139\.55\.34.143
RewriteCond %{REQUEST_URI} !^.*oldsite.*$
RewriteRule ^(.*)$ http://kitchencookstoves.com/oldsite/ [R=303]

Could any one please give us a tip on what we are missing? I have created a temporary ftp user so you can access the public_html and .htaccess file to edit:

temp@example.com temp123 -or- here is a quick screen cast:

http://www.screencast.com/t/Bi4Eeikf

Thanks for any tips!!

1 Reply to “Building a new eccomerce site while the old …”

Posted by Joseph Shrock

————–OR————–

For example instead of seeing:

http://kitchencookstoves.com/oldsite/index.php
http://kitchencookstoves.com/oldsite/about.php
http://kitchencookstoves.com/oldsite/contact.php

I only want to only see:

http://kitchencookstoves.com/index.php
http://kitchencookstoves.com/about.php
http://kitchencookstoves.com/contact.php

What would I then have to add to the below htaccess code to hide the /oldsite/ in the url?

RewriteCond %{HTTP_HOST} ^www.kitchencookstoves.com$ [OR]
RewriteCond %{HTTP_HOST} ^kitchencookstoves.com$
#RewriteCond %{REMOTE_HOST} !^139\.55\.34.143
RewriteCond %{REQUEST_URI} !^.*oldsite.*$
RewriteRule ^(.*)$ http://kitchencookstoves.com/oldsite/ [R=302]

Thanks!!