Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. Share your own thoughts and experience, accounts may be terminated for violations.
  • Welcome to AcornDomains.co.uk, a friendly community for UK domain investors, developers and anyone interested in domain names.

    Whether you're looking to buy or sell domains, learn more about the UK domain market, get feedback on your names, or simply chat with other domainers, you're in the right place. AcornDomains has been bringing together people from across the UK domain industry for many years, from complete beginners to experienced investors.

    Have a look around, join the discussions and, if you haven't already, create a free account and introduce yourself.

.htaccess duplicate content redirect problem

Status
Not open for further replies.
Joined
Oct 17, 2008
Posts
152
Reaction score
0
Hi,

Any htaccess gurus, help will be appreciated,

Google has indexed no existant pages on my site causing duplicate content issues because the .htaccess is not redirecting /? urls properly.

Google has cached the following Urls in the format shown below, i need to 404 them some how :(:confused:

Code:
http://www.somesite.co.uk/?http://www.somesite.co.uk/

Options +FollowSymlinks
RewriteEngine on



# Externally redirect direct client requests for script filepaths back to "friendly" extensionless URLs
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([^/]*/)*[^.]+\.php([?#][^\ ]*)?\ HTTP/
RewriteRule ^(([^/]*/)*[^.]+)\.php$ /$1/ [R=301,L]

# Externally redirect to add missing trailing slashes to extensionless URL requests
RewriteCond $1 !\.[a-z]+[0-9]?$
RewriteRule ^(.*[^/])$ http://www.somesite.co.uk/$1/ [R=301,L]

# Externally redirect all non-canonical hostname requests to canonical hostname
RewriteCond %{HTTP_HOST} !^www\.somesite\.co\.uk$
RewriteRule ^(.*)$ http://www.somesite.co.uk/$1 [R=301,L]

# Internally rewrite all requests ending with slash to php scripts
RewriteRule ^(.*)/$ /$1.php [L]
 
I'm no technical htaccess guru so will leave that for someone else, but you should consider adding /?* to your robots.txt file to let Google know it shouldn't be indexing any URLs with question marks - unless for whatever reason you do need some ? URLs indexed, in which case put something like /?http*
 
Status
Not open for further replies.
Top Bottom