Solved

http redirection

Posted on 2009-07-15
5
189 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
solution not totally clear
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 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

9 Experts available now in Live!

Get 1:1 Help Now