Welcome to WebmasterWorld Guest from 54.144.68.27

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Reverse Lookup Issues

     

chalkywhite

9:30 pm on Dec 1, 2013 (gmt 0)



Hi guys ( not even sure this is the correct forum so if this needs moving mods then please do :) ).

Recently moved all my sites to a VPS, all the sites are fine, but when I do a check to see what other sites are hosted on this IP it shows one site as;

domain.com
www.domain.com

Where as all the other sites just show www.domain.com. Ive set the canonical url on all pages as www. The site is Wordpress driven

Now ive checked all DNS settings on all sites to compare and they all have the correct a records, cnames etc. So im at a loss. The only thing that im not 100% on as im no apache expert is the rewrites. I want all non www to go to www.

This is the directives ive set in apache.

DocumentRoot "/var/www/domain.com/public_html"
<Directory "/var/www/domain.com/public_html">
Options FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^http://domain.com$ [NC]
RewriteRule ^(.*)$http://www.domain.com/$1 [R=301,L]
Options +Indexes
</Directory>

Are they fine and I still have to find what is causing this?

lucy24

11:15 pm on Dec 1, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Options FollowSymlinks
<snip>
Options +Indexes

Is there a reason for having this as two separate items when they're both inside the same <Directory> section?

RewriteCond %{HTTP_HOST} ^http://domain.com$ [NC]

Whoops! Does it really say that, or did you go into autopilot when typing the post? This line should say

RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$


No protocol-- that would be a separate ruleset, if needed-- and the condition should be expressed negatively as "If the host is anything other than the form I want".

chalkywhite

10:32 am on Dec 2, 2013 (gmt 0)



Hi Lucy, yep that's what it says, was a copy and paste bar the domains. I'm rubbish with this sort of stuff ;).

Ive changed the Rewite condition, thanks! .

There is no particular reason for the two separate items, how would you configure this line?

lucy24

4:56 pm on Dec 2, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



If you use the
Options +blahblah -blahblah
form, you can put everything on a single line. The only time you'd need to use
Options blahblah otherblahblah
without plusses is when you need to be absolutely certain you're starting with a clean slate: "Only these options and no others." Otherwise use plus and minus forms: "Add this option if it isn't there already / Remove this option if it was previously enabled".

chalkywhite

7:39 pm on Dec 2, 2013 (gmt 0)



Brilliant thanks. Thought id put some time in today and read the options directive. It now makes more sense.

[httpd.apache.org...]
 

Featured Threads

Hot Threads This Week

Hot Threads This Month