Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

.htaccess page load different URL

Posted on 2009-07-03
3
Medium Priority
?
457 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Many of the companies I’ve worked with have embraced cloud solutions due to their desire to “get out of the datacenter business.” The ability to achieve better security and availability, and the speed with which they are able to deploy, is far grea…
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
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…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

824 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