• Hi all.

    I want to put a WordPress installation under a different domain where is supossed to work. For example, in my host I want to put WP in the folder /home/domain/webusers/madcore (url to that folder is https://www.domain.com/~madcore), but It was before in /home/domain/httpdocs/madcore.domain.com (url to that folder is madcore.domain.com, a subdomain). The reason to make that is FTP access, because under the first folder can be accessed with a personal and separatted ftp acount, but the second one (the subdomain), can be accessed only with the domain main ftp account. I want to “fake” traffic, making that people who put the url madcore.domain.com/whatever goes to https://www.domain.com/~madcore/whatever. It′s that possible in some way with the use of .htaccess and the mod_rewrite method? Where I can found some info about the mod_rewrite functions?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Put this in your .htaccess:
    redirect permanent old-url new-url

    or optionally:
    Redirect /olddirectory/oldfile.html https://yoursite.com/newdirectory/newfile.html

    A true Apache mod_rewrite rule though is:
    RewriteEngine on
    RewriteRule ^old\.html$ new.html

    Note the special characters in this one.
    Surely one will work for you

    Thread Starter madcore

    (@madcore)

    I′ve tried with the two methods, but doesn′t work. The first .htaccess I tried is that:

    RewriteEngine on
    RewriteRule ^index.php$ https://www.nn45.com/~pelayo/index.php

    And is in pelayo.nn45.com. What I′m doing wrong?

    OK here goes:
    RewriteEngine on
    RewriteRule ^index.php$ nn45.com/~pelayo/index.php

    This is assuming:

    this is placed in the .htaccess of the site you’re redirecting FROM

    index.php is in the root of whatever site you’re redirecting FROM

    TO nn45.com/~pelayo/index.php

    Good luck and post back if this is not what you meant.

    EDIT***
    For some reason the backslash won’t post even wrapped with the backtics.

    There must be a backslash after
    index and before .php

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘About .htaccess and mod_rewrite’ is closed to new replies.