Forum Moderators: phranque

Message Too Old, No Replies

How to remove ?NF=1 from urls

Odd?NF=1 showing in urls on bing.com

         

Kelowna

2:05 am on Dec 19, 2009 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hi,

I need some .htaccess help to remove duplicate pages that are appearing on bing.com. I am seeing my site listed in the serps as [mysite.com...] and even [mysite.com...]

I think it is caused by people linking to me using spaces in the url after the / but not completely sure.

Does anyone know the correct .htaccess code to redirect this sort of thing back to just mysite.com/ without the extra ?NF=1 added on to the end? It is only happening to the main index page as well. My site is not dynamic or anything so my .htaccess is quite empty except for the removal of the www from the url using this...

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.mysite\.com [NC]
RewriteRule ^(.*)$ [mysite.com...] [L,R=301]

If anyone knows a quick (cut and paste) solution that would be great.

jdMorgan

4:07 pm on Dec 19, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try this search [google.com] for a good start.

If you have specific questions after reviewing those threads and testing your code, please post them back here.

Our Forum Charter [webmasterworld.com] provides links to useful resources, and information about how to get the most from this forum.

Jim

Kelowna

6:33 pm on Dec 19, 2009 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thanks Jim,

I found this in an older post of yours and it worked perfect...

rewritecond %{query_string} .
RewriteRule (.*) http://www.example.com/$1? [R=301,L]

I was searching for answers before but I did not use the right search terms to find this answer, thanks again for your help.

--Pete

g1smd

8:48 am on Jan 3, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That code clears all query strings from all URLs.

Be sure that is exactly what you want to do.

jdMorgan

8:37 pm on Jan 3, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, which can be problematic if you have a 'stats' package hosted in you account space, and that stats package uses query strings, which is fairly common...

It may be necessary to add an exclusion for the '/stats' subdirectory in that case.

Jim