Solved

.htaccess page load different URL

Posted on 2009-07-03
3
444 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
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…
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…

758 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

20 Experts available now in Live!

Get 1:1 Help Now