Forum Moderators: phranque

Message Too Old, No Replies

displaying parked domain

is it possible via .htaccess?

         

specter

7:39 pm on Sep 3, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello,

I have a parked domain, say, parked.com, and an existing one, say, example.com;
actually, if I type in "parked.com", it simply redirects to "example.com".

I would instead my site visible either as "parked.com" and "example.com"

Is it possible to get such a result?
htaccess?

Thanks

g1smd

10:32 pm on Sep 3, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes it is, but that is "Duplicate Content" and Google will pick one to list and one to not list.

They make that choice for you.

The purpose of the redirect is so that you make the choice instead.

specter

10:52 am on Sep 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Really I have two sites under the same domain:
one in the root dir say,example.com and one in a subdir, say example.com/sub/.
What I would do is to display the root site under the main domain and the subdir domain under the parked one:
example.com rests example.com
example.com/sub/ becomes parked.com/sub/

of course with the needed canonicalization and redirects in order to avoid duplicate issues (f.e., parked.com should not match example.com).

hope was clear...

Is it possible?difficult?

g1smd

11:53 am on Sep 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Ah. That is a different question.

Yes. Of course you can do that.

Serve www.one.com from /user/public_html on server.

Serve www.two.com from /user/public_html/subsite folder on server.

Also set up a redirect so that requests for http://www.one.com/folder/ are redirected to http://www.two.com/ to avoid Duplicate Content issues.

You need to be clear that URLs on the web, and filepaths on the server, are two different things and you can map them any way that you like.

jdMorgan

1:20 pm on Sep 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



However, as long as that second domain remains "parked," there will always be a redirect for every HTTP request made to it; Users will find it to be "slow-loading," and I suspect that that domain will never rank very well.

If you want to use the domain then host it properly, with the DNS pointing directly to the server, and not to some "parking service" in the middle.

Jim

specter

8:38 pm on Sep 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



well,

My host requires a shameful fee to do that:

I already tested my site and if I remove the canonicalization redirect it runs fine just as I would: no slowness or other related issue.

So I only should adjust some redirections in order to canonicalize both domains and to get them operating for different sites avoiding duplicate issues:

I would that example.com is canonicalized and rests example.com.

parked.com is canonicalized and matches example.com/sub/

example.com doesn't match parked.com.
Parked.com doesn't match example.com.

How can I start getting this?

Thanks

specter

9:39 pm on Sep 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok.

I edited canonicalization redirect in this way:

Original rule

RewriteCond %{HTTP_HOST}!^www\.example\.net

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

My edit

RewriteCond %{HTTP_HOST} ^example\.net

RewriteRule (.*) http://www.example.net/$1 [R=301]

RewriteCond %{HTTP_HOST} ^parked\.net

RewriteRule (.*) [parked.net...] [R=301,L]

Now both domains work fine and show the same sites:
Next step: avoiding dupe content.
Parked.net only redirects on example.com/sub/

Could you suggest me how to edit the rules?
Adding a further one?

Thanks

g1smd

11:00 pm on Sep 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Additional Rule.

I would have it as the first rule of the three.

RewriteCond %{HTTP_HOST} ^(www\.)?example\.net

RewriteRule ^foldername(.*) http://www.parked.net/$1 [R=301]

Quadrille

11:07 pm on Sep 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Wouldn't it be easier to get a decent host and set up the domain properly?

My host allows me unlimited domains on the same package, and I'm sure others do similar.

Why go for complex and confusing workarounds when you can just set up a plain old fashioned web site?

g1smd

11:45 pm on Sep 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



In most cases, those unlimited domains can still also be accessed as if they were a folder off the main site.

This additional redirect stops that accidental Duplicate Content loophole from ever being exploited and indexed.

specter

11:09 am on Sep 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok I added the rule you suggested Gs1d, but I edited it:

RewriteCond %{HTTP_HOST} ^(www\.)?example\.net

RewriteRule ^sub(.*) [parked.net...] [R=301]

RewriteCond %{HTTP_HOST} ^example\.net

RewriteRule (.*) http://www.example.net/$1 [R=301]

RewriteCond %{HTTP_HOST} ^parked\.net

RewriteRule (.*) [parked.net...] [R=301,L]

Now I get example.net/sub/ redirecting to parked.net/sub/ as I want (but url contains a slash more: parked.net/sub// instead of parked.net/sub/).

example.net rests example.net.

But parked.net still matches example.net...

g1smd

1:24 pm on Sep 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Try this:

RewriteRule ^sub/(.*) http://www.parked.net/sub/$1 [R=301,L]

.

However, don't you want the second site to be served as if it were in the root of parked.net?

RewriteRule ^sub/(.*) http://www.parked.net/$1 [R=301,L]

.

You also need the [L] flag on the rule as it is the Last rule that needs to be processed.

specter

7:26 pm on Sep 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok.I got the result in that way:

#canonicalize parked domain
RewriteCond %{HTTP_HOST} ^parked\.net

RewriteRule (.*) [parked.net...] [R=301]

#redirects parked domain search.pl file requests to the main one preventing duplicate issue
RewriteCond %{HTTP_HOST} ^www\.parked\.net

RewriteRule ^search.pl(.*) [main.net...] [R=301]

#canonicalize main domain
RewriteCond %{HTTP_HOST} ^main\.net

RewriteRule (.*) [main.net...] [R=301]

#redirects main domain sub requests to the parked one
RewriteCond %{HTTP_HOST} ^www\.main\.net

RewriteRule ^sub/(.*) [parked.net...] [R=301,L]

The rules work fine formy pourpose only in that exact order.

Do you see something wrong?
Could they be rewritten in a simplest way?
Are they bug proof (am I missing something that opens to duplicate issues)?

Thanks for your kind feedbacks :-)

g1smd

7:36 pm on Sep 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Did you see that main.net/sub will be redirected to www.main.net/sub and then redirected again to www.parked.net?

I warned about that in a post above.

Again, the rules also need [L] to be added.

Do the specific requests first, with domain canonicalisation included in the rule.

Then do the general domain canonicalisation for all other URLs afterwards.

specter

7:44 pm on Sep 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Did you see that main.net/sub will be redirected to www.main.net/sub and then redirected again to www.parked.net?
I warned about that in a post above.

It's what I want:canonicalizes and redirects but to parked.net/sub/.
It's that what I see.Am I wrong?

Again, the rules also need [L] to be added.

For each one?

Do the specific requests first, with domain canonicalisation included in the rule.

Then do the general domain canonicalisation for all other URLs afterwards.

I'm not able to do that...
Could you help me please?

Thanks

g1smd

8:30 pm on Sep 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You want all non-www to go to www.

You also want a "specific thing" to redirect to one specific place.

.

Do the "specific" thing first, making sure that it works for any starting domain, and that domain canonicalisation is also included in that rule for the "specific" thing.

Lastly do the "general" thing; that is for "all other" URLs (i.e. all the non-www).

.

It is just a case of putting all of the rules in the correct order.

Check the example out in [webmasterworld.com...] to see what mean about that.

That example caters for one specific file path first (whether www or non-www), then for all index files (whether www or non-www), and then finally for all the others (everything non-www).