Permanent URL masking for mirroring website using php and htaccess


Remixed version of unstable human emotions and thirst of mankind actions. UX designer, UI developer and HE of WebCastle Media Pvt LTD

You may also like...

21 Responses

  1. spring bed guhdo says:

    If you would like to increase your know-how only keep visiting this website and be updated with the hottest information posted

  2. Steve says:

    thanks for this script, but not good work for me (not correct show images).
    Problem is when image code or not

    I commenet (add //) line:
    // $content = str_replace(‘src=”/’,’src=”http://’.$wc_mirror.’/’,$content);

    Now work all fine.


  3. tom says:

    Hi Remiz,

    Have uploaded your files at our site which is redirecting to, but on clicking any link opens only the home page

    Please advice

  4. Kranthi says:

    Hi Remiz,

    Great Job… kudos from my team….

    Thank You..

  5. D says:

    Is is it possible to tweak the code so subdomains get passed on to the mirror? Ex: will load (under the mask).

    • D says:

      I was actually able to modify this code to get it to work with subdomains! ๐Ÿ™‚ Now I have another question… instead of having it load, how can I get the mirror domain to load a specific page in sourcedomain such as I tried making $wc_source = and it doesn’t work.

      • D says:

        Ok, my bad for the barrage of emails. I actually figured out how to load a specific page by changing the $URI… Last question! Stylesheets actually are not loading properly… ๐Ÿ™ Any fix for this?

    • Nathan says:

      How did you get it to work with sub domains?

  6. Blade says:

    All is great but why after i submit data (form use POST method and Header redirect if all is correct with login)
    I not get anything and home page reload without any massage or correct redirection to member page?

  7. Labib says:

    you are genius ๐Ÿ˜‰

  8. Marilou Jowell says:

    Hi, Neat post. There’s an issue together with your web site in internet explorer, would test this? IE still is the market chief and a big element of people will leave out your great writing due to this problem.

  9. Willy Helmsing says:

    I have been looking for something like this for a while. I am very happy to hear you have had success with it. I am going to surprise my partner and get myself a pack of this. Hopefully it will work for me like it has for you.

  10. George says:

    I have dropped your code in, but the images and stylesheets aren’t loading up.

    What could the issue be?


  11. fehmi says:

    what about if wc_source is a subfolder like

  12. ImDKG says:

    Thanx buddy I have wasted lot of time in this code searching you have done a tremandous work. ๐Ÿ™‚

  13. Supriyadi says:

    Hi Remiz,

    It works for a few days but today I got same message as Arash.

    Any advise to solve this issue?


  14. WebHoster says:

    Wow.. great article. thanks a lot for sharing

  15. Miggy says:

    I just did this but why do I get a message Object Moved. This object may be found here (link). I thought it’s supposed to automatically redirect on its own. Did i do something wrong?

  16. Arash says:

    Hi again,
    I do appreciate your help ๐Ÿ˜‰

  17. Arash says:

    Hi Remiz,
    Thanks for your nice tip ๐Ÿ™‚
    I just tried it, but when I visit my “” it givs me the following error:

    Unable to open socked: php_network_getaddresses: getaddrinfo failed: Name or service not known (0)

    any idea?
    Thanks a lot for your time ๐Ÿ™‚

Talk your view

Read previous post:
Mullaperiyar – An Appeal from half dead human to sleeping mankind

If we die tomorrow we are not going to complaint no more about it. News papers and TV channels may...