Solved

http redirection

Posted on 2009-07-15
5
190 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unable To Access a Web Domain From Our Network 16 84
Two nodes for updates and forwarding 8 51
Firewall Speed Issue 6 66
Domino Website - Redirection 12 52
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…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

910 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

17 Experts available now in Live!

Get 1:1 Help Now