PowWeb Forums - The Perfect Community for the Perfect Host  

Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more.

Go Back   PowWeb Community Forums > The PowWeb Platform > .htaccess / Scheduled Jobs
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Closed Thread
 
Thread Tools
Old 6-6-02, 11:55 PM   #1
naborsapts
 
Join Date: Apr 2002
Location: New York City
Posts: 78
Reputation: 5
Question htaccess redirect keeping original URL

Hello there!

All the information I've found here in the forum and elsewhere Re: htaccess redirect talks about redirecting a specific directory or file to another directory or file or URL. Examples:

Redirect*/*http://www.domain2.com = redirects any files in the original domain to the same files in domain2 (keeping original file structure)

Redirect /* http://www.domain2.com = redirects any files in the original domain to the index page of domain2 (does not keep original structure)

Redirect /subdirectory1 /subdirectory2 = redirects any files/subdirectories in subdirectory1 to subdirectory2 (keeping original file structure)

What I need is the following:

I have a second domain name (domain2.com) that's pointing to my main account (domain1.com). I want to redirect any requests for domain2.com to a file in a subdirectory within domain1, but I don't want to rewrite the URL in the address bar (I want the "true" original URL to appear).

Is the following the correct syntax?

Redirect http://*.domain2.com http://www.domain1.com/subdirectory/file.html

(The asterisk is because I want both www.domain2.com and domain2.com to redirect to the same file in domain1.)

Thanks for your help.
naborsapts is offline  
Old 6-7-02, 12:45 AM   #2
MannInc
Guest
 
Posts: n/a
You might try this:

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} domain2.com
RewriteCond %{REQUEST_URI} !mychatfolder/
RewriteRule ^(.*)$ http://www.domain1.com/subfolder/$1 [L]

Let us know if this works for you.
 
Old 6-7-02, 10:23 PM   #3
Jeff321
Customer Since 2001
 
Join Date: Dec 2001
Location: IL, USA
Posts: 1,880
Reputation: 14
I used this code:



Options +FollowSymlinks
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} domain2.com
RewriteCond %{REQUEST_URI} !subdirectory/
RewriteRule ^(.*)$ subdirectory/$1 [L]


If you want a specific file, you should be able to replace the last line with something like this (I have not tested this though):

RewriteRule ^(.*)$ subdirectory/file.html$1 [L]
Jeff321 is offline  
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:09 AM.


Contents ©PowWeb, Inc. ~ vBulletin, Copyright © 2000-2007 Jelsoft Enterprises Limited.