Solved

http redirection

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

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

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…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

831 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