Sign up for Updates
Build a Review Site with WordPress and WP Review
Recent Posts
Subscribe for eMail Updates

Subscribe to the Niche Store BuilderDon't miss a single post about Developing your Niche Store or Website! Subscribe today and start Making Money!

Subscribe to the Niche Store Builder Subscribe in Google ReaderAdd The Niche Store Builder to Technorati Favorites! Add to My Yahoo! Add to My AOL

Redirecting an Existing BANS Store to your Blog Folder

October 2, 2008

Much of the headache involved with adding a WordPress blog to an existing BANS site revolves around the re-directions needed, once you move BANS off the domain root. I am hoping I have found a workaround to this and testing continues now! The process was so simple… I actually had a “Pop myself in the Head” moment! If you want to leave BANS where it is and still have your Blog come up as the homepage of your site… read on!

Adding a Blog to BANS without Moving your BANS Store off the Root

First, you have to understand a bit about the way a webserver works. Anytime someone pulls up yourdomain.com, the server software looks for the index file. It will usually go through a sequence like this:

  1. Find - index.htm - If not exists…
  2. Find - index.html - If not exists…
  3. Find - index.php - If not exists…
  4. Next… next… next

Depending on your server software, it may go through several of these lookups for index, default, etc etc, until it finds the one that contains your index file.

With BANS, we obviously use index.php to control the functionality of our home directory. Index.php is also heavily rewritten in the htaccess file, so in effect, the index.php is never truly indexed with search engines! ALL of your existing pagerank lies in the / root directory, with no file association at all, thanks to the htaccess mod rewrite.

Creating a Solution

1 - Login to your cPanel > File Manager > and navigate to the root of your domain, where your BANS Software is currently installed.

newfile.gif2 - In the ROOT of your BANS store, click on Create New File and name the new file: index.htm

There is no need to edit this file at all - it is only being used as a redirect for us. ANY blank file will work, as long as you name it index.htm.

3 - Click one time on your .htaccess file, and from the right side menu, choose edit. We now need to tell ALL visitors that our homepage has moved to the blog directory.

4 - ON THE FIRST LINE of your htaccess file,  place the following line: (Replace yourwebsite and /blog, with your site info)

IF this is an Addon Domain - Add this:

redirect 301 /index.htm http://www.yourwebsite.com/blog/

IF This is the MAIN PRIMARY Domain on your Hosting account, Add this:

RewriteCond %{HTTP_HOST} ^(www\.)?yourwebsite\.com
RewriteRule ^index.htm$ http://www.yourwebsite.com/blog [R=301,L,N]

We needed to handle the redirect a bit differently on a MAIN /public_html domain, as the htaccess has a role in ALL you add on domains as well. In this case, we are first asking: Is this yourwebsite.com (Main Domain), if yes, redirect it.

5 - Save the htaccess, close it all up and test your work by typing your domain name into your browser!

How it Works

We MUST leave the index.php where it is, because as we know, it controls everything that happens on our BANS site. Since we created an index.htm file, the webserver will always try to display it before the index.php file. (You could change this in the server config files, but thats another post)

After we have the index.htm in place, we can simply tell the server and all browsers, through the htaccess file, to redirect it to the blog directory! Every time a search engine or visitor lands on your main domain name, it now automagically redirects to your blog!

Also - since index.php is the file that does control the BANS software, ALL of your existing pages will work just fine!

Preserving the PageRank

This is the one section I have not confirmed as of yet… but realistically andlogically, since our index files truly never get indexed in search engines due to the BANS htaccess, the pagerank flows with our / domain name at the root. We are NOT redirecting the root / of our sites in this case, just the index.htm file, therefore ALL existing Pagerank should remain with our BANS root.

If you have any issues… just shoot me an email!

Update for Those that it is not working for

On the VERY TOP LINE of your root htaccess file, you need to instruct apache to use index.html as your default document, before it looks for the index.php. Add the following to your htaccess:

DirectoryIndex index.html index.php

Mark

Comments

42 Responses to “Redirecting an Existing BANS Store to your Blog Folder”

  1. Bryan on October 2nd, 2008 1:56 pm

    Good work Mark. I had some questions about this, thanks.

  2. Steve on October 2nd, 2008 4:09 pm

    Wow! Nice work mark.

    How does this affect how the blog looks under the BANS template?

    Can it be that easy to add a blog to an existing BANS without adversely affecting the indexing and search engine ranking?

  3. Mark on October 2nd, 2008 4:12 pm

    @ Steve -

    This method ONLY deals with the site redirect… to show your blog page as the homepage.

    The themes will still need to be merged together.

    Mark

  4. Bob on October 2nd, 2008 4:40 pm

    Just tried it on one of my sites, very nice!

    Question: I have a few BANS site that got de-index. If I add a blog (in a blog folder) and do the redirect to the blog, will Google pick up on this and re-index the site or will it require some Google groveling on my part.

    Bob

  5. Mark on October 2nd, 2008 4:52 pm

    @ Bob -

    I wish it were that easy…. :-)

    Its always worth a try though!

    Mark

  6. Virginia on October 2nd, 2008 5:13 pm

    Question: I have a BANS site and blog with matching templates. (not one of Marks’). How do I link them together? I have looked and looked for an explanation of how to do this but have not found it. I was planning to leave BANS as the root and have the blog in a folder. Can anyone point me in the right direction?

  7. Hugo Santos on October 2nd, 2008 6:36 pm

    this comes real handy.i have just installed a blog on a bans site and i was thinking that it should be on the root :)

  8. Bill G on October 2nd, 2008 7:37 pm

    Thanks Mark I really needed this
    BG.

  9. Mark on October 2nd, 2008 8:54 pm

    @ All -

    Please review this post again… Thanks to Jeffleft, I found that there needs to be one extra bit of code if you are redirecting your main domain, versus an addon domain. Both sections of code are relisted above.

    If you already added it to an addon domain… no issues or changes at all.

    If you added to a MAIN or root domain (The main domain on your hosting account) you will need to make the change referenced above.

    Mark

  10. Victoria on October 3rd, 2008 5:21 am

    Great work Mark, I really needed help with this.

    Your explanation was easy to follow even for a newbie like me.

    Thanks,

    Victoria

  11. Thrandur on October 3rd, 2008 6:16 am

    Hey Mark!

    This is really cool 8)

    I get this to work for:
    http://my-diet-program.com/index.htm
    but not
    http://my-diet-program.com

    You mention changes in the server config files - could that be a solution?

  12. Mark on October 3rd, 2008 8:41 am

    @ Thrandur -

    Off for sure… but I only tested the most popular configs with HG servers. If you want to shoot me over some cPanel info, I would be happy to look into it.

    Mark

  13. Thrandur on October 3rd, 2008 9:23 am

    Thanks for looking into this, Mark :)

    I am running this website on Bluehost, so the settings might be slightly different.

    I’m shooting you an email…

  14. Mark on October 3rd, 2008 9:50 am

    @ Thrandur -

    It is all set!

    in your case with BlueHost, they do not recognize the index.htm as the default sequence of files and instead, looked for index.html (Added the L onto the end)

    I changed your index.htm to index.html, and made the needed change to your htaccess to look for …html at the end of the file, and it is all good now!

    Mark

  15. Thrandur on October 3rd, 2008 1:53 pm

    WOW - thanks Mark!

  16. G B SINGH on October 4th, 2008 9:30 am

    Hi Thrandur,

    How does one reach from http://my-diet-program.com - which has now become http://my-diet-program.com/blog/ - to the old home page of your BANS store, i.e., http://my-diet-program.com/index.php ?

  17. Mark on October 4th, 2008 9:35 am

    @ BG -

    ALL of your store links are still in your sidebar menu… but if you wanted, you could also add a “Store” link to your main menu, and just point it to the first level of your store:

    http://www.my-diet-program.com/Diet/

    Mark

  18. G B SINGH on October 4th, 2008 10:02 am

    Thanks Mark,

    BTW Thrandur has not done it, so I got curious… aren’t you practically wasting the very first page of your BANS store (old) by not adding this link in the sidebar?

  19. Mark on October 4th, 2008 10:11 am

    @ GB -

    If you have custom text on your homepage that was optimized and delivering alot of visitors, you may want to turn it into a post or something.

    Overall, I think getting BANS off the main landing page of the site outweighs the pain being felt by deindexing, so its really just a personal choice for me.

    Old - Static BANS page, with high percentage of duplicate content

    New - Very dynamic and constantly changing page, with 100% unique content.

    Mark

  20. kim on October 4th, 2008 3:29 pm

    Hi Mark~

    I,ve been trying to follow your steps above; however, I don’t see a .htaccess file under my public_html directory. What am I missing? Or could it be called something else?

    I’m using Hostgator, if that matters. Love your site~very helpful.

    Thanks in advance.. kim

  21. Mark on October 4th, 2008 9:14 pm

    @ Kim -

    In your cPanel > File manager, there is a checkbox in the settings section to show hidden files.

    Make sure it is checked to show.

    Welcome in also!!

    Mark

  22. kim on October 4th, 2008 11:47 pm

    Great~ found it Mark. Thanks!

    One more question: When you type yourwebsite into the code (above) to be placed in that file, am I supposed to put the entire site address from http and the way to .net ?

    I’m getting internal server errors.

    Thanks for your time helping a real rookie~ Kim

  23. Julie on October 5th, 2008 12:11 am

    Mark,
    You are a genius!! It worked for me.

    On another subject….one of my sites has been de-indexed by Google since September. Has there been a post yet about recommended steps to get Google back? Should something be done other than consistently adding content?

  24. Lionmom100 - Yael on October 5th, 2008 1:01 am

    Mark,

    Do I need to do this if I bought the template from you? I got the template that supports an existing store. It doesn’t seem to work right and we talked before about the problem, but I got sidetracked by the moving stuff we are doing and never fixed it.

    Yael

  25. Mark on October 5th, 2008 9:38 am

    @ Kim -

    The code should look identical to the above, with the exception of the “yourwebsite” piece. The http, .coms, all that is already there. Now, if it is a .net site, you would need to change the com to a net.

    If its giving you a headache… just shoot me an email and the domain info to look it over.

    @ Julie -

    I truly wish I had an answer… I think I am on the cusp of getting one of my longtime sites back in, but it has been a 6 month road of constant updates and complete movement of the BANS side of it. I DO intend to write a post abut the experience in the coming days…

    @ Yael -

    Yes. Regardless of the template, if BANS is on the root and you want it into a folder, you do need to do the forwarding.

    Mark

  26. Alice on October 5th, 2008 2:58 pm

    I want to do this for my main site but wondered about if I have to do more redirects of content I redirected originally when I converted the site to BANS WP. There were named domain.com/articlename and I redirected them to domain.com/blog/articlename. Do I need to do ANOTHER set of redirects if I make this change??

  27. Elijah on October 7th, 2008 6:04 pm

    Mark,

    I love your tutorials man - despite your own beliefs I still believe you’re an awesome teacher!

    I can’t remember the last time I followed something you layed out and had the end result be nothing shy of perfect the first time around!

  28. Mark on October 8th, 2008 10:12 am

    Thanks Elijah!

    Now if I can just get myself to finish some of these tutorials… I will be good to go! LOL

  29. Alice on October 8th, 2008 1:34 pm

    I’m curious about whether this is really the same as moving BANS off the root and into a folder… Doesn’t Google etc “know” that its just a redirect, and that really BANS is still in the root?

  30. Mark on October 8th, 2008 2:26 pm

    @ Alice -

    Redirecting your homepage is TRULY done for your visitors first… send them RIGHT to the fresh content you update daily first.

    As for Google… your BANS index is truly NOT on the root anymore as far as they see it. Your BANS directory may physically be located on the root folder, but all pages are served through your first level content page url. They also know you want people to land on your blog versus your BANS duplicate-content page, which benefits both them and your visitors.

    Essentially the ONLY BANS page EVER on the root of a domain as far as search goes, is the main page. EVERY other page is usually in the /store/link directory, which it still is.

  31. G B SINGH on November 2nd, 2008 9:28 pm

    Mark,

    Did you get my comment that I posted here on this post:

    “Redirecting an Existing BANS Store to your Blog Folder”

    Or not?

  32. Mark on November 4th, 2008 7:09 am

    @ GB -

    Please resubmit the question - it’s not posted here.

    Mark

  33. G B SINGH on November 4th, 2008 11:08 am

    Hello Mark,

    The code given above is not working on my MAIN PRIMARY Domain of my Hosting account as some other redirections are also there on it, like:

    RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^eye/?$ http://eye.thirdeyehealth.com [R=301,L]

    RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^life/?$ http://life.lifesip.com [R=301,L]

    RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^eyeblog/?$ “http\:\/\/blog\.thirdeyehealth\.com” [R=301,L]

    RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^lifeblog/?$ “http\:\/\/blog\.lifesip\.com” [R=301,L]

    What’s the way out, do you know?

  34. G B SINGH on November 4th, 2008 11:10 am

    Yes Mark,

    I have posted the same question third time now, take care in moderation this time.

    Thanks.

  35. Alice on November 4th, 2008 3:06 pm

    whoa there dude, you’re out of line. Mark generously and WITHOUT CHARGE provides a valuable service to a big community. If you’re not happy with it, go somewhere else and PAY for someone who will “take care in moderation” just for you!

  36. Mark on November 4th, 2008 3:25 pm

    @ Alice -

    Thanks for stickin up for me! :-)

    @ GB -

    Your sites are not domains, they are subdomains, so it will not work the same (Or possibly at all) for them, in the way it will for a domain itself.

    Subdomains are handled in a different way, and may have to be done by Hostgator in the actual DNS, versus simple changes to your htaccess.

    Mark

  37. G B SINGH on November 4th, 2008 9:24 pm

    No Mark,

    But my MAIN PRIMARY Domain is a proper domain and it is this proper domain that I am talking about!

  38. G B SINGH on November 4th, 2008 9:43 pm

    Alice,

    If Mark is offering a service to a community, it’s out of his own volunteering for doing so.

    Yes, I do appreciate him (and I do it a lot!) but not blindly!

    If in his venture of offering (of his own will) a service he goes off the track, I will be the first man to point out to that.

    I appreciate, I don’t flatter.

  39. Alice on November 5th, 2008 3:51 am

    @GB

    What is freely given can be just as easily ungiven. We’re not entitled to endless freebies just because we demand them. Stop whining like a spoiled brat who can’t get to the cookie jar!

  40. G B SINGH on November 5th, 2008 5:57 am

    Alice,

    Nothing is being demanded here. Mark is offering something in order to get a flow of readers to his blog that promotes his business at the end of the day.

    And these readers do have a democratic right to comment on his quality of offerings going this way or that, mind it.

    In my humble opinion, you are behaving like a fanatic disciple trying to safeguard your cult-figure that you have started worshiping… by now!

  41. Mark on November 10th, 2008 1:57 pm

    @ All -

    For anyone having trouble with this after the HG or other server upgrades, add this to the TOP of your root level htaccess file:

    DirectoryIndex index.html index.php

    Mark

  42. yuyo on November 19th, 2008 12:31 pm

    Thanks for the info this is my primary domain in my hosting service i did how is stated above :

    RewriteCond %{HTTP_HOST} ^(www\.)?azecorp\.com
    RewriteRule ^index.htm$ http://www.azecorp.com/blog [R=301,L,N]

    but is not working any help.

    Thanks

Got something to say?





Featured Links and Resources

I'm such a Twit for Tweets

Posting tweet...

Top Niche Builder Commentators

Last 10 Comments

Blogroll

Niche Builder Categories