|
| Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Join Date: Apr 2002
Location: New York City
Posts: 78
Reputation: 5
|
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. |
|
|
|
|
#2 |
|
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. |
|
|
#3 |
|
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] |
|
|
![]() |
| Thread Tools | |
|
|