• Resolved gagan_3057

    (@gagan_3057)


    I have a blog at https://gagankalra.totalbarmy.org and I have moved it to https://totalbarmy.org.

    The blog is moved without any error(Permalinks have been changed as well) but I have following issues.
    1) How to redirect all my users to new address? Should I delete my previous folder from the server?
    2) How to redirect search engine traffic to the new location?
    3) As of now both the blogs are using same database, so obviously they look exactly the same. But displaying the same data at two places doesn’t make much sense.

    So the bottom like question is:
    What to do so that all the users (from search engines and direct) get redirected automatically to new address i.e. https://totalbarmy.org

Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    1 and 2) .htaccess baby!

    # SubDomains
    RewriteCond %{HTTP_HOST} ^gagankalra.totalbarmy.org  [OR]
    RewriteCond %{HTTP_HOST} ^www.gagankalra.totalbarmy.org
    RewriteRule ^(.*)$ https://totalbarmy.org/$1 [R=301,L]

    That should do it. (the www. is there because some people are really freakin’ weird).

    3) Since gagankalra.totalbarmy.org is a redirect page, you can just delete the subdomain in your cpanel or whatever and let the .htaccess rule from No. 1 above (which you would put in the totalbarmy.org public_html folder – ABOVE the WordPress rules) handle it. And have a beer.

    Thread Starter gagan_3057

    (@gagan_3057)

    Wao! It worked…really thanks a lot. I really owe you this one.

    Most of the redirects are fine but lets say when it comes to

    https://gagankalra.totalbarmy.org/author/admin/

    It should transfer to

    https://totalbarmy.org/author/admin/

    Right?
    But it doesn’t…rather it transfer to

    https://totalbarmy.org/gagankalra/author/admin/

    which ofcourse doesn’t exist?
    Any idea why this is happening?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    It shouldn’t unless there’s some other redirect in there. OR perhaps there’s something old from the old URL cached somewhere…

    But. You can do a similar redirect for it.

    RedirectRule ^gagankalra/author/(.*)$ https://totalbarmy.org/author/$1 [R=301,L]

    I hope that’s right. I’m writing this on my phone ??

    Thread Starter gagan_3057

    (@gagan_3057)

    Long ago in my wp-config.php, I added these two lines

    define('WP_HOME','https://totalbarmy.org');
    define('WP_SITEURL','https://totalbarmy.org');

    Can this make a difference?

    What is happening is, it is looking for a folder ‘gagankalra’ inside the root folder. Although rest of the links are working fine but even they get redirected to

    https://totalbarmy.org/gagankalra/hello-world
    for a sec but then the final result is

    https://totalbarmy.org/hello-world

    Try this one
    https://gagankalra.totalbarmy.org
    and see where you land….
    I am pretty sure you’ll have a good idea about the problem now.
    Please sir, I salute you for being so kind to this poor Indian guy. Please help.

    On a different note, I read your resume on your website. I simply envy you. You really have done a lot.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    The lines in your wp-config don’t matter. It’s your server saying ‘I don’t have the subdomain gagankalra but I do have a subfolder!’ Which usually means you didn’t turn off the redirect.

    Did you turn off the subdomain redirect on the server? I’m not asking about the .htaccess, but the place on, say, cPanel, where you defined your server subdomain. That needs to go away ??

    If that IS gone and this still happens, put an .htaccess in your gagankalra folder with this:

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^(.*)$ https://totalbarmy.org/$1 [R=301,L]
    </IfModule>

    If THAT fails, paste up the WHOLE copy of what’s in the .htaccess in your root html folder and we’ll dig through it ??

    Thread Starter gagan_3057

    (@gagan_3057)

    Sir, you are a genius!!!!
    Tell me, where do you need a party?
    I am coming to Chicago to give you one, if I can get your appointment ??

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    *rotfl* No worries. I’ve had a lot of painful times getting htaccess and subdomains to play friendly. (And it’s ‘ma’am’ as it happens).

    Thread Starter gagan_3057

    (@gagan_3057)

    What?…is it….awww…I am so sorry…lol…Actually your name is a male Indian name so that’s why I got confused….sorry…
    but thanks again ??

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Oh, it’s a male name in every language except Japanese. I’m SO used to that mistake ??

    Here is a problem that I THINK goes along with the above. I built a client site within a subdomain on MY server. I then tried to upload the whole kit and kaboodle over to HIS server. I imported the database from my cpanel to his. I of course thought that I was very smart. Heh…I was WRONG. I deleted my subdomain folder and everything but the front page of HIS site went away. Had to call the helpdesk at my Host to save me. My question is how did that happen, and how do I transfer properly? I still want to get him off MY host and completely on to his. Please help.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Transferring blog from sub-domain to root’ is closed to new replies.