Tell me more ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a website hosted in yahoo small business, I don't have access to .htaccess file. I have around 220 pages in a folder 'mysubfolder' (http://mysite.com/myfolder/mysubfolder). And the age of website is around 3 years.

I am planning to move all 220 pages in 'mysubfolder' to 'myfolder' (one level up). All the pages in 'mysubfolder' are indexed.

what is the best way to do this.So that it should not affects the SEO.

share|improve this question
But the best way to do this is using the .htaccess file ;) – Tom Sarduy Nov 7 '12 at 7:57
1  
Do you have access to a Page Redirect Manager? "Using Page Redirect Manager, you can create page-level 301 redirects to direct your site pages to new page locations." – w3d Nov 7 '12 at 8:19
@w3d: That looks like an answer to me. – Ilmari Karonen Nov 7 '12 at 23:40

2 Answers

If you are using some server side language(PHP, Python, ...) is not difficult get all the URLs finishing on mysubfolder/* and then redirect to the new folder using Redirect 301

This is a 301 redirect using PHP:

header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.newdomain.com/newdir/newpage.htm");
exit();

If the files are .html and you can't use server side then you should add

<META HTTP-EQUIV=Refresh CONTENT="0; URL=http://mysite.com/myfolder/foo.html">

to all files on subfolder (I recommend download files, then use some text editor with Find & Replace function and upload agin). In any case you should avoid to use Javascript redirect.

share|improve this answer
2  
"upload a robots.txt file to subfolder" - A robots.txt file should only ever go in the top level folder. ie http://mysite.com/robots.txt. So the disallow line would need to read: Disallow: /myfolder/mysubfolder/ (if this is to be implemented). – w3d Nov 7 '12 at 12:34
1  
...and in any case, using robots.txt to disallow the old URLs would mean that search engines will not see the redirects and won't know that the pages have moved. Generally that would be a bad idea. – Ilmari Karonen Nov 7 '12 at 23:37
yes, thats right, 301 redirect is the only way to tell the search engines that the page is moved. otherwise it leads to 404 error. – Vinay Nov 8 '12 at 4:10
@w3d, updated answer, I had no idea that robots.txt can be only on the root, I thought it worked because I use it to block subdomains, subfolders at the end right? – Tom Sarduy Nov 8 '12 at 20:06
@Tom: It works for subdomains if the robots.txt file is in the top level folder for that subdomain. ie. http://subdomain.mysite.com/robots.txt. If this is also accessible via the subfolder... /mysite.com/subdomain/ then this will not work, it will now look for http://mysite.com/robots.txt. But, as mentioned by Ilmari Karonen above, blocking these files using robots.txt is probably not recommended anyway because you are also blocking the redirect. – w3d Nov 9 '12 at 0:49

Another potential option would be to follow the advice listed here - http://www.craniumstorm.com/moving-wordpress-and-yahoo-small-business-hosting/ and create a redirect file in a index.php file. Now, this may or may not work depending on the site you have setup. If its a CMS based site that defaults to looking for the index.php file first, it will work great. If its a bunch of static html files, probably not so much. Either way it wouldn't hurt to give it a try.

 <?php
$request = $_SERVER["REQUEST_URI"];
$request_a = explode("/", $request);
$count = count($request_a) - 1;
$request_res = "";
for ($i = 3; $i <= $count; $i++) {
    $request_res .= "/" . $request_a[$i];
}
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.newdomainfoo.com/bar" . $request_res);
exit();
?>

There is also the CSV file upload redirect manager that you could use if you could easily create a list of your current urls, and new urls, however that could be a pain.

The best option would be to migrate away from Yahoo Small Business as it seems rather restricting in many areas. It would be very easy to setup 301 redirects then, but that is outside the purview of your question :)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.