Solved

http redirection

Posted on 2009-07-15
5
191 Views
Last Modified: 2012-05-07
Hi ,

I am  planning to phase out my previous url www.mydomain.com/mypage and replace it by myplace.com

I have a rewrite rule in the virtual host configuration file of myplace as below:

RewriteEngine   On
RewriteRule     ^/(.*)  http://www.mydomain.com/mypage [R]

Now, whenever I type myplace.com in the browser, it fetches the web pages from www.mydomain.com/mypage properly. It does its job...

but the problem over here is, it also at the same time changes URL in the address bar of the browser to www.mydomain.com/mypage.

I simply want pages to be fetched from www.mydomain.com/mypage whenever I type mypage.com. I don't want any changes in URL of the browser. How do I avoid it ??
0
Comment
Question by:its_ns_04
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:kevin_u
ID: 24866706
The [R] causes a redirect, which tells the browser to go to the new url, hence it changes the address bar.

Since your virtual host probably needs mydomain.com in the request headers, a redirect is probably required, and there is no easy fix.   However, if both domains are on the same virtual host, you may be able to do rewrite rules that just direct it to the new content (with out the [R], but also more importantly with out the domain name) that might reside in a different directory.

0
 
LVL 1

Author Comment

by:its_ns_04
ID: 24869769
hmm.. I tried without [R] too...but it is not helping me...

do u have any clues on how to fix it ?
0
 
LVL 12

Accepted Solution

by:
kevin_u earned 500 total points
ID: 24875244
The only other solution available to you is to redirect mydomain.com to mydomain.com/framepage.html.  Then framepage.html would be a full screen frame totally encapsulating myplace.com.  The address bar remains as mydomain.com/framepage.html (or whatever more inocuous name you'd like to call that page)
0
 
LVL 8

Expert Comment

by:allen-davis
ID: 24884978
I believe you can do what you want by using the proxy functionality of mod_rewrite.  Try changing the [R] for redirect to a [P] for proxy and see what happens.  I'm not sure if you need to add a few more tweaks or not.

take a look at this link for a bit more info:

http://httpd.apache.org/docs/1.3/misc/rewriteguide.htmlhttp://httpd.apache.org/docs/1.3/misc/rewriteguide.html
0
 
LVL 1

Author Closing Comment

by:its_ns_04
ID: 31603991
solution not totally clear
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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