Solved

.htaccess page load different URL

Posted on 2009-07-03
3
452 Views
Last Modified: 2015-01-05
Hi guys,

Wondering if you can shine some light a problem I am having... Something Id like to do...

Id like to have
http://abc.domain1.com.au -> point to -> http://www.domain2.com.au/abc

But I dont want have the URL change, I want it to stay as http://abc.domain1.com.au even though it is loading content from http://www.domain2.com.au/abc. So you would never see: http://www.domain2.com.au/abc or know that it is loading this URL.

Is this possible?

Ive tried playing the dynamic sub domains, DNS settings... and think the possible solution would be use to utilize a .htaccess file... but don't know how to code it...

hope someone can provide some working code to resolve this problem...

Thanks!
0
Comment
Question by:dev09
3 Comments
 
LVL 17

Expert Comment

by:selvol
ID: 24771905
0
 

Author Comment

by:dev09
ID: 24782155
Thanks, I've tried... the code...

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} domain2.com
RewriteCond %{REQUEST_URI} !/abc
RewriteRule ^(.*)$ abc/$1 [L]

but it doesn't seem to want to work..  Can someone please test this for me?
on another domain and let me know how it goes...

Thanks!
0
 
LVL 7

Accepted Solution

by:
stephenhoekstra earned 500 total points
ID: 24938910
there is probably a better way, but what you can do is create vhosts for the subdomains and put a .htaccess in each containing the line
RedirectMatch ^/$ http://www.domain2.com.au/abc

that'll redirect and be transparent to your users.

if both domains are hosted locally you could use
RewriteEngine on
RewriteRule   ^/$  /path/to/domain2.com.au/abc


http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This video teaches users how to migrate an existing Wordpress website to a new domain.

828 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