1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Duplicated Pages listed by google - .htaccess problem?

Discussion in 'Apache' started by Jez, Jun 12, 2012.

  1. #1
    Hi, google has listed quite a lot of my pages twice (disaster). Some with trailing slash (/) and some without. The redirect should redirect to URL without/

    Could someone take a look and let me know if it's right or wrong? The redirect works as it will redirec url/ to url for me but obviously is not for google.

    I see that some URL in the .htaccess have / and some do not. Is this confusing the redirect?

    #redirects from old site
    redirect 301 /example1.htm http:// www. mytopsecretdomain.net/example1/
    redirect 301 /example2.htm http:// www. mytopsecretdomain.net/
    redirect 301 /example3.htm http:// www. mytopsecretdomain/example3/
    redirect 301 /example4.htm http:// mytopsecretdomain/example4/
    redirect 301 /example5.htm http:// mytopsecretdomain/example5/
    redirect 301 /example6.htm http:// mytopsecretdomain/example6/
    
    redirect 301 /site-map3.xml http:// mytopsecretdomain/about-us/blog-sitemap/
    redirect 301 /contact.php http:// mytopsecretdomain/contact-us/
    redirect 301 /blog/ /about-us/blog/
    
    RedirectMatch 301 ^/example10(.*) http:// www. mytopsercetdomain.net/example10/
    RedirectMatch 301 ^/example11(.*) http:// www. mytopsecretdomain.net
    RedirectMatch 301 ^/example12(.*) http:// www. mytopsecretdomain.net
    RedirectMatch 301 ^/example13(.*) http:// www. mytopsecretdomain.net
    RedirectMatch 301 ^/example14(.*) http:// www. mytopsecretdomain.net
    RedirectMatch 301 ^/example15(.*) http:// www. mytopsecretdomain.net
    RedirectMatch 301 ^/example16(.*) http:// www. mytopsecretdomain.net
    RedirectMatch 301 ^/example17(.*) http:// www. mytopsecretdomain.net/example17/
    RedirectMatch 301 ^/example18/(.*) http:// www. mytopsecretdomain.net/example18/
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    Code (markup):
     
    Jez, Jun 12, 2012 IP