Forum Moderators: phranque
Can I perform that from cpanel just entering something or manually writting something in .htaccess?
What syntax do I use then?
And how do avoid search engines to index those pages?
You can't exclude them in robots.txt right?
Normally, you'd set up a 302 redirect to do this. But you should carefully examine your reasons for doing this, and avoid it if possible.
Many Webmasters believe they need to do a redirect like this when doing a total site update (also not a good idea, but sometimes unavoidable), and miss the possibility of simple *rewriting* the URLs to a subdirectory on their own server which contains a copy of the old site. The new site can then be installed into a second subdirectory, and tested there using a subdomain to access it. When the testing is finished, you simply change the rewrite to point to the new subdirectory, or rename the subdirectory.
I use four subdirectories: back(up), prod(uction), test, and dev(elopment), for backup, final/current content, stuff that's ready to be tested for release, and 'experimental' content respectively. As experiments are finished, content is moved from devel to test for final testing by others. When testing is complete, this content is moved to prod and the previous released version is moved to backup. This can easily be achieved by simply (but carefully) renaming and/or copying the directories. By doing so in conjunction with careful cache-control header management, the new site appears 'instantly' when the directory is renamed, and the site is never offline.
In theory, using a 302 redirect should work, and according to the HTTP specifications, it's the right thing to do. However, you're relying on the search engines to handle it properly, and we have all seen the reports posted here of occasional problems with their handling of redirects -- temporary and permanent. You must decide if the need is pressing enough to be worth the risk.
Jim
Performed the update (3 days) then removed the 302 from my site and now traffic is comming as always to my site.
Seems like I had no problems this far.
My concerns: is my other domain/subdirectory with robots txt saying all bots not to crawl gonna generate problems? (dupe content?)
Is it safer to delete the files and upload again when needed (IE: next update)?
Perhaps is there other strategies for achieving the same results.