Forum Moderators: phranque
Headers are returning a code 200, which is not good at all. That just seems way to open for dupe content issues.
I've searched all over and can't find any reference to this other than that it's "a good way to #@*$ competitors". Hmm, not good news.
So how can I add a 301 redirect to properly to remove the dot?
(Sorry I keep asking questions. I do try, but I just can't grasp this stuff enough to write it myself. I've read tutorials, lurk here making notes.. it just seems my mind is not built to process .htaccess. I really do appreciate all the help!)
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com(:80)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
Otherwise, if you don't wish to allow the port number, you can just end-anchor the hostname:
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
Jim
http://www.example.com/?=DSL
http://www.example.com/?=BED
Those are not pages in our website but Yahoo indexed them as duplicates of our home page! I tried creating a 404 page but was not able to do so using Front Page. The next thing I tried is to use a robots.txt file to Disallow: /?
I need some help. any suggestions would be greatly appreciated. thanks! Chris.
[edited by: jdMorgan at 11:34 pm (utc) on Sep. 28, 2006]
[edit reason] Example.com [/edit]
If you have no place at all that uses query strings in your sites, this works:
#remove useless ?junk
RewriteCond %{THE_REQUEST} [?]
RewriteRule ^(.*)$ http://example.com/$1? [R=301,L]
If you have a few files that need the query string (search, a form etc.), here's how to do that:
#remove useless query strings, keep needed ones
RewriteCond %{THE_REQUEST} [?]
RewriteCond %{REQUEST_URI} !^/path-to/file-excluded-from-rule/filename\.pl$
RewriteCond %{REQUEST_URI} !^/another/excluded/file\.php$
RewriteRule ^(.*)$ http://example.com/$1? [R=301,L]
As I said above, I'm no expert (pretty much a lost newbie at this), but this is working for me.
Be sure to clear your cache and test the headers after any change. If you use Firefox, the LiveHTTPHeaders extension works great.
Edit:
The forum was removing the space between }!
Be sure to check and edit that back in if you try this code.
[edited by: LunaC at 1:06 pm (utc) on Sep. 28, 2006]
#remove useless?junk
RewriteCond %{THE_REQUEST} [?]
RewriteRule ^(.*)$ http://example.com/$1? [R=404,L]
Thanks guys I'm new to this.
[edited by: jdMorgan at 11:34 pm (utc) on Sep. 28, 2006]
[edit reason] Example.com [/edit]