Complete URL masking with mod_rewrite

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Complete URL masking with mod_rewrite

Post by pickle »

Hi All,

I've searched many a website for a solution to this, and I haven't found one yet.

What I'm trying to do is essentially make one sub-domain display the pages from another sub-domain.

So, if I've got a request for a file at:

http://users.server.com/joe_user/test.html

I want it to display the files found at:

http://www.server.com/departments/users ... /test.html

So far, this is all I've been able to find that sounds relevant. I'm not an ace with this stuff, so I'm not really sure why this isn't working. This .htaccess file is found at the root of the sub-domain

Code: Select all

RewriteEngine on
RewriteBase /

RewriteRule ^/(.*)$ http://www.server.com/departments/users/$1  їR,L]
Any ideas? Thanks.

Almost forgot: Both subdomains are hosted on the same Linux box.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply