301 Redirect Demo website links to Live Site. Webmaster Errors...HELP!

ran60616

Regular Member
Joined
Jan 17, 2013
Messages
219
Reaction score
298
Hi All,

Need some help from people who might know this subject.

I created a DEMO site to test a new theme on my live domain/site like this > www.mysite.com/demo/ (all the pages in my live site).

Now I have successfully switched the new theme to the live site, and hence lost all the links that goes by www.mysite.com/demo/...

Unfortunately Google indexed all the pages that my demo site had > www.mysite.com/demo/ (more than 1000 pages). Therefore now it's throwing 404 page errors on Google Webmaster Tools.

Will adding a 301 redirect from www.mysite.com/demo to www.mysite.com via .htaccess file solve this issue? If so, what is the correct code I need to add?

Any help would be much appreciated.

Thanks!
 
Under www.mysite.com/demo
add a .htaccess with the following:

Code:
RewriteRule ^demo/(.*)$ /$1 [R=301,NC,L]
Now go to the urls and check if everything redirects properly. Once done, go to your webmasters account. GO to the 404 error list. Select all and mark as fixed.
 
Last edited:
Under www.mysite.com/demo
add an .hhtaccess with the following:

Code:
RewriteRule ^demo/(.*)$ /$1 [R=301,NC,L]
Now go to the urls and check if everything redirects properly. Once done, go to your webmasters account. GO to the 404 error list. Select all and mark as fixed.

THANK YOU so much for the help.

One question, I have a .htaccess file for the www.mysite.com only, since as mentioned I created the Demo site on my live website with a separate WP install. Since deleting all that and moving the new theme to the live site, I have no access to any demo files.

Only have direct access to the www.mysite.com .htaccess file via YOAST SEO plugin :)

Thanks again!
 
Well, you would need FTP.A shell script can do the trick but I can't discuss that over here, as hacking discussions are not permitted in BHW.

You will need to move all the files to the root. your sub-folder will only have the .htaccess file with the above-mentioned rule.

THANK YOU so much for the help.

One question, I have a .htaccess file for the www.mysite.com only, since as mentioned I created the Demo site on my live website with a separate WP install. Since deleting all that and moving the new theme to the live site, I have no access to any demo files.

Only have direct access to the www.mysite.com .htaccess file via YOAST SEO plugin :)

Thanks again!
 
Back
Top