Apache mod_rewrite from one server to another

Posted on 2006-05-31
Last Modified: 2010-03-04
I am afraid I no nothing about php or apache, sorry.
I am wanting to use mod_rewrite to link/redirect a page on one server to another page on a seperate server.  The reason being is I have built a system using asp which the first server does not support so need  a link from one to other, preferably maintaining the original URL in the address bar.

I have got a simple directive to work in the .htaccess file such as:

RewriteEngine on
RewriteRule ^ally.html$ bob.html

So with no knowledge I tried this:

RewriteEngine on
RewriteRule ^ally.html$

Thanks for nay help with this.
Question by:rabbits2

    Author Comment

    So far I have figured it out to redirect to the correct place by:

    RewriteRule ^ally.html$

    But still need assistance on how to include another directive to mask the url it is going to and maintain the original site url and if I set this url in the address bar to say read
    will I  need to change the pages within the ASP application to use the new domain as well surely not?

    LVL 16

    Accepted Solution


    I think its possible to use proxying heres what I mean:

    Rewrite ^ally.html$ [P]

    That will server the page from the other server without
    alerting the user :)

    Hope this helps

    Author Comment

    None of these suggestions seem to work.  sorry.

    Assisted Solution

    Hm. xDamox proxy rewrite seems correct to me.

    If the server is behind a firewall which denys outgoing http requests the Apache will not be able to proxy the requests from your old server to the new one. To check open a browser on the server and see if you can connect to If you dont have a browser on your server check by trying to connect using telnet on port 80:

    on command prompt:
    telnet 80
    If the connection is allowed the prompt will not appear again. Then type

    GET /

    and hit enter.

    If you see HTML code being downloaded from the firewall is open. In that case your server can proxy the requests and the rewrite is wrong. If you dont get an valid answer your firewall is closed and the proxy rewrite will no work.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
    It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now