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. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

.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.

Rule #1: Be Respectful

Do not insult any other member. Be polite and do business. Thank you!

Premium Members

New Threads

Domain Forum Friends

Lastest Listings

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Siusaidh AcornBot:
    Siusaidh has left the room.
      Siusaidh AcornBot: Siusaidh has left the room.
      Top Bottom