Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Redirect subdomain to secure


gosman - 12:54 pm on Jan 3, 2012 (gmt 0)


Hi g1smd

What I'm trying to do is stop the SE's indexing content at httpS://secure.domain.tld to avoid a dupe content penalty.

Here's where I've go to.

I've included the following in the .htaccess

RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^robots.txt$ robots_ssl.txt

I then have the following in my robots_ssl.txt

User-agent: *
Disallow: /

This is working fine and the correct robots.txt is being displayed if I browse to httpS: //secure.domain.tld

However if I browse to http ://secure.domain.tld it's exactly the same as browsing to http: //www.domain.tld

What I'm trying to achieve is any SE entering at http: //secure.domain.tld will be redirected to httpS: //secure.domain.tld and the appropriate robots.txt will be displayed.

Hope this makes sense.


Thread source:: http://www.webmasterworld.com/apache/4402861.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com