Forum Moderators: phranque

Message Too Old, No Replies

Domain rewrite using .htaccess

         

pwest

5:36 pm on Aug 24, 2004 (gmt 0)

10+ Year Member



I have been searching this forum for someone who is doing what I am trying to do but no luck so far. Maybe someone here can shed some light on this. I have a domain, www.example2.com that forwards to www.example.com/pn. I simply want a user to be able to type in www.example2.com and have this domain name show in the address bar in the browser.

To be more specific, when a user clicks on the NEWS link, the address bar shows:

[example.com...]

I would like it to show:

[example2.com...]

At a minimum I would like the domain rewritten to show example2.com.

How can I do this? Thanks a million!

Phil

[edited by: jdMorgan at 6:33 pm (utc) on Aug. 24, 2004]
[edit reason] No specific URLs per TOS. Thanks [/edit]

jdMorgan

6:36 pm on Aug 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How is the forwarding accomplished, specifically?

If it is done with a 301 or 302 redirect, then mod_rewrite can't help you. (Test with the WebmasterWorld server headers checker [webmasterworld.com]).

If you have simply pointed both domains to the same IP address via DNS, then you can use mod_rewrite.

If the domains are hosted on separate servers, then you'll need to use mod_proxy.

Jim

pwest

6:46 pm on Aug 24, 2004 (gmt 0)

10+ Year Member



Yes, I can definately point both domains to the same IP. The thing that I would want to do in that case is use mod_rewrite to redirect the request (from the domain www.aboutgeeks.com) to a subdirectory on the host (directory = /pn). With this said, what would the .htaccess file contain?

Thanks for the help.
Phil

jdMorgan

7:00 pm on Aug 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can't write the code for you -- that's against our policies here (Please see our forum charter [webmasterworld.com]). But see this thread on Rewriting arbitrary subdomains to subdirectories [webmasterworld.com]. The code posted there in msg#6 may help you get started.

Jim