• Okay so before you guys draw any conclusions from the title please read the following.

    So I have a main site that is named “domain.com” and now one of my sections is very large and so I’ve decided to create a whole new site with it. Here is the problem though, I can get the URLs to redirect, but they’ll only redirect to my main site’s domain “domain.com” but I want a new domain for my new site, “website.com” but this is the problem. Since I am using my old domain already I can’t just forward all requests to the new domain, only certain requests need to go to the new domain. How can I do this ?

    Just to clear things up if it will help. The section that I am breaking off is the only one that will run on wordpress, my main site currently does not run on wordpress, but the section with the domain name of “website.com” will run on wordpress. Is it possible that all requests that come from “domain.com” and try to access the wordpress platform, it will automatically change the domain from “domain.com” to “website.com” since only this section will run on wordpress, this technique would work.

    Any help would be appreciated.

Viewing 11 replies - 1 through 11 (of 11 total)
  • At the risk of giving you an “old technology answer”, may I suggest you explore a Search and Replace solution? Hopefully, there are unique characteristics of the URLs you want to change, as compared to the URLs you don’t want to change.

    If your web site is currently all just “hand maintained” .html files, use a powerful text editor like NotePad++ that allows you to Search and Replace a whole bunch of files with a single operation.

    Obvious caveat: backup everything before doing your first Search and Replace. And keep that backup for a couple of months.

    Thread Starter faeron

    (@faeron)

    Sadly that won’t work.

    I can’t do that first of all, they aren’t simple .html pages.

    Secondly its actually a huge forum but only one section is being moved to wordpress. Since this section will be on its own, it will now have a new domain name on it as stated above. I can get the redirections done for the same domain, I just need some way for the domain to redirect to the new domain when it hits any type of wordpress URL structure. I know this can be done easily, I just don’t know how.

    I can’t just forward all requests on my old domain to my new one since i’ll be still using my old domain for the main site.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    I can’t do that first of all, they aren’t simple .html pages.

    If they have defined URLs on the old domain.com then you can create a list and at the top of your .htaccess file place the rewrite rules for just those specific URLs.

    This would go on the old domain.com server and not on website.com.

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule old-url-goes-here/ https://website.com/old-url-goes-here/ [R=301,L]
    RewriteRule another-url-goes-here/ https://website.com/another-url-goes-here/ [R=301,L]
    RewriteRule you-get-the-idea/ https://website.com/you-get-the-idea/ [R=301,L]
    </IfModule>
    Thread Starter faeron

    (@faeron)

    @jan Dembowski this would work if i only had a few hundred links or something.

    I have over 10 thousand links, that won’t be the most efficient way to do it .

    Is it not possible to put some type of condition in the .htaccess file, for example if the url structure matches that of wordpress, then it would redirect to the new domain name. For example

    RewriteRule some-wordpress/url/structure/here/ https://website.com/some-wordpress/url/structure/here [R=301, L]

    Do you get what I mean ? Since my main site is not using wordpress in any way, the URL structure is going to be different. So as long as something like what I’ve stated above can work it should be easy. All that needs to be done is that if it is a WordPress url structure just change the domain name from “domain.com” to “website.com” everything else would stay the same (the rest of the url)

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    That’s doable but the syntax is tricky. Try this out:

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule some-wordpress-url/(.*) https://website.com/other-wordpress/$1 [R=301,L]
    </IfModule>
    Thread Starter faeron

    (@faeron)

    Is it possible that I install the new site in a directory, and then we just redirect all links within that directory to the new domain with normal wordpress links..? Could that possibly work ?

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    If you mean redirect all of https://domain.com/some-wordpress-url/* to https://website.com/other-wordpress/* then yes. You would do that with the .htaccess file I mentioned above.

    But the syntax is tricky. The one I copied above I use for sending all URLs hitting my old servername to the new one. My original looks like this:

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

    Without any sub-directory. The URLs you have are not all the ones off of the root, so the syntax is a little different. Thus the “syntax is tricky” comment. ??

    Thread Starter faeron

    (@faeron)

    I meant like for the wordpress site… I install it in a whole new directory such as “domain.com/wordpress” … so when redirecting links to make it specifically for the wordpress links all I’d need to do is the following

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule /wordpress/* https://website.com/$1 [R=301,L]
    </IfModule>

    Would this not work ? This way my old domain would be okay and all links should be working, and for the new wordpress site it should be able to redirect without any problems with the other urls.

    I’ve got the same/similar issue. Have trawled the documentation and this forum for a solution however…

    I would like setup a muli site system where QR codes resolving to a main .mobi domain and then rediected to different wordpress installes within subdomains.

    mysite.com -> sub.mysite.com

    But the redirect plugin is stripping out the domain information and parsing to a subdirectory structure within the main domain
    mysite.com/sub.mysite.com/

    Before finding this plugin I was considering just using .httaccess directly however I would like a solution where my clients can manage redirection themselves.

    If the plugin cant do a redirection to ‘another site’ – which I’d be surprised that it can’t – I will probably just setup multi-site wordpress, installed in sub folders, messy.

    please ignore my earlier post. It works fine right out of the box. I was having a cache issue – doah!

    Hello,

    I nave my NEW domain pointing to my WordPress folder. Domain: original-republican.com. My old domain was hyperblogcafe.com

    For legacy purposes, I have a carbon copy of the folder, and still have hyperblogcafe.com pointing to a copy of the folder, as there are still 3 years of links posted in various places like Facebook and Twitter.

    My question is similar to the above question(s):

    Since I have not changed, and do not plan to change, the permalink structure at The Original Republican, is it possible, when someone clicks on a hyperblogcafe link, to change (or re-direct) hyperblogcafe.com to original-republican.com?

    Can one of the above suggestions make that happen?

    Thank you,
    Mark

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Redirect old domain to new domain, how ?’ is closed to new replies.