Forum Moderators: phranque

Message Too Old, No Replies

.htaccess paranoia

.htaccess paranoia

         

rockdigital

8:51 pm on Apr 18, 2005 (gmt 0)

10+ Year Member



main domain = example.com
domain1 to point at = example_6.com
domain2 to point at = example_fr.com

example_6.com and example_fr.com are parked "to" example.com

if i add an .htaccess file to www.example.com/ consisting of:


RewriteCond %{HTTP_HOST}!^example_fr.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

RewriteCond %{HTTP_HOST}!^example_6.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

will that cause example_6.com and example_fr.com to resolve to http://example.com (content and format)?

will it affect the resolution of example.com itself?

i don't want to use index.cgi because it causes the resolution to be in the format http://example.com/index.html, which i don't prefer

does .htaccess slow down server performance?

would any change need to be made to local dns? (i'm not 100% sure what "parked to" means as regards local dns)

finally, will this approach preserve my search site counts while pointing users to the new domain?

thanks in advance for your expertise

- dave

[edited by: jdMorgan at 9:38 pm (utc) on April 18, 2005]
[edit reason] Removed specifics per TOS. [/edit]

jd01

10:27 pm on Apr 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi rockdigital -

Are you asking if you can redirect both domains to example.com using the rules provided?

If you are, you will need to place each rule in it's respective domain .htaccess file, and as long as you are redirecting everything, to an identical directory structure, you could simply use:

RewriteRule ^(.*)$ [example.com...] [R=301,L]

This will move any request to example.com/whatever.

Technically the () are not needed - I use them to keep things straight in my head most of the time.

This will not effect the performance of example.com, because the redirects are being generated to it externally, so the request comes as a full http header.

Yes, excessive .htaccess will slow performance, depending on the structure of your files/directories, you may be able to optimize the regular expression you use to something less cumbersome than (.*), but this single rule should not make a very large or noticable difference in your server performance...

A 301 redirect, will transfer your inbound links... Not sure what you mean by:
finally, will this approach preserve my search site counts while pointing users to the new domain?

Hope this helps.

Justin

rockdigital

12:02 am on Apr 19, 2005 (gmt 0)

10+ Year Member



thanks justin

let me attempt to interpret your reply

add example_6.com and example_fr.com as virtual domains

then place an .htaccess file for each domain with the code:

RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

and that will cause example_6.com and example_fr.com to resolve as
http://example.com/
or
http://example.com/index.html
and
the format of example.com itself will not be affected

do i have it right?

thanks for taking the time to respond

- dave

[edited by: jdMorgan at 1:19 am (utc) on April 19, 2005]
[edit reason] Removed specifics, Please see TOS. [/edit]

jd01

12:24 am on Apr 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not sure I understand what you are doing...

I thought you currently had two domains you wanted to redirect to a single domain...

Do you have these domains now?

Or, are you wanting to add domains, which use content from a domain you currently have?

Please, be specific in what you are trying to accomplish.

Justin

PS Always use examples rather than actual domains and files, you'll keep the moderators happy ;)

rockdigital

1:05 am on Apr 20, 2005 (gmt 0)

10+ Year Member



i have an active domain
example.com

i have two domain names parked to example.com:
example2.com and example3.com

currently both domain names point to the content of example.com

i want them to continue to point to the content of example.com and also resolve to "http://example.com"

example2.com and example3.com have no independent content

thanks -dave

[edited by: jdMorgan at 7:44 pm (utc) on Feb. 11, 2008]
[edit reason] example.com [/edit]