WordPress.org

Ready to get started?Download WordPress

Forums

htaccess redirect question (7 posts)

  1. krembo99
    Member
    Posted 5 years ago #

    I think i alreadz know the anser to this one, but just to make sure.
    I have 2 domains, one (www.domain01.com) that is where the hosting space is , and the second, (www.domain02.com) where there is only name with redirect.
    Both on the same machine.
    Is it posssiable (with mod_rewrite for example) to put all the files on domain01.com (where the hosting is) but when people go to the website (and search engines for SEO) will actually see http://www.domain02.com , and that all the posts will also be http://www.domain02.com/wordpress/post (and pages etc..) so actually people will digit http://www.domain02.com, will be phisically redirected to http://www.domain01.com, but the permalinks, seo etc will stay domain02.com ???

  2. brainycat
    Member
    Posted 5 years ago #

    -- duplicate post deleted --

  3. brainycat
    Member
    Posted 5 years ago #

    If both of the domains are on the same server, the easiest solution is to change the DOCROOT of domain02 to point to the directory where domain01 is serving from.

    WordPress keeps it's URL in the database. Where wpdb=WPDataBase, my installation keeps the records in:
    wpdb.options.optionname "siteurl"
    wpdb.options.optionname "home"

    Additionally, the admin area uses a lot of POST methods, that may break if you try to cloak domain01. There's a lot of docs on how to move a WP installation if you search the codex and the forums.

  4. krembo99
    Member
    Posted 5 years ago #

    Thanks for your reply..
    What I am trying to achive is not exactly transfering the domain (which I know how to do), but to BUILD a new web inside a new domain, but having all the traffic redirected from domainname01 to domainame02, but having all people (and search roots) see domainname01 , even if the site is on domainname02.
    If I do a simple redirect, the traffic will arrive, but the URL will always be of domainname02, or not ?

  5. brainycat
    Member
    Posted 5 years ago #

    Simply redirecting from domain01 will change the URL. See http://en.wikipedia.org/wiki/HTTP_codes#3xx_Redirection for details.

    I've never tried to mirror or cloak a domain using WP. With that caveat, I don't think it would work via DNS because of the POST forms and softcoded URLs in the database. I don't think it would work via redirects or rewrites either, for the same reason.

    Give it a try and let us know how it works.

    Your best bet would probably be to create an invisible frame at domain01 and load domain02 into it, which will work for most human visitors but break SEO.

    http://wordpress.org/extend/plugins/domain-mirror/ might help you achieve what you're looking for.

  6. lgtaylor
    Member
    Posted 5 years ago #

    krembo99, there is malware attached to the site that your user name is linked to.

  7. krembo99
    Member
    Posted 5 years ago #

    yes, I know, I have removed it , Thanks.
    My server was hacked a while ago, should be ok now (until the next hack ..)

Topic Closed

This topic has been closed to new replies.

About this Topic