I discovered search engines found duplicate content on my domain due to URLs being output with index.php?p=
and index.php
in ADDITION to the clean URLs.
For example, I have:
domain.com/index.php?p=about
domain.com/index.php/about
domain.com/about
And the first two requests with index.php?p=
and index.php
shouldn't exist. Only the last request with domain.com/about
should exist.
While I found help removing index.php
, some URLs continue to include ?p=
.
So, now I still have:
domain.com/?p=about
domain.com/about
While all I want is:
domain.com/about
Note: This is happening to several pages and blog entries throughout the site. Not only URLs directed to about
.
How may I remove ?p=
permanently from the remaining URLs?
Within .htaccess, I have:
<IfModule mod_rewrite.c>
RewriteEngine On
# Remove index.php
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{REQUEST_URI} !^/index\.php/admin\b [NC] # Don't mess with admin requests
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
# Send would-be 404 requests to Craft
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
RewriteRule (.+) index.php?p=$1 [QSA,L]
</IfModule>
Within craft/config/general.php, I have:
return array(
'*' => array(
'omitScriptNameInUrls' => true,
),
);