• Hello,

    My htacess file looks like below:

    # 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

    The problem is all pages are returning 301 redirect. I want the https://www.domain.com to return 200 OK response and the rest 301 as it is. Can you help?

Viewing 7 replies - 1 through 7 (of 7 total)
  • That shouldn’t be returning 301 redirects. Something odd is going on. What is your URL?

    Is there a dot in front of that filename:

    .htaccess <=====correct

    Thread Starter yahiasylhety

    (@yahiasylhety)

    Here is the url https://www.sharebodybyvi.com/.
    And yes there is a .htaccess file – the coding is as per above.

    You don’t have a lot of pages returning 301. I only found one– https://www.sharebodybyvi.com/?cat=1 redirects to https://www.sharebodybyvi.com/category/blog. You can fix that by getting the URL correct on that link.

    Thread Starter yahiasylhety

    (@yahiasylhety)

    This is not correct. Please use the following tool to understand what i means:

    https://www.ragepank.com/redirect-check/

    Also https://www.sharebodybyvi.com/?cat=1 is reedireting to blog page which is perfect.

    The site is adding a trailing slash, and doing a few other things, like redirecting bad requests to your 404 page. The only real 301 that I didn’t notice before is the one from https://www.sharebodybyvi.com to https://www.sharebodybyvi.com/. The others listed on that site are for non-existent pages. In other words, that site you found is trying to crawl a bunch of common pages, none of which exist on your site– like the .asp pages. It isn’t actually crawling your site, meaning that is not representative of what is happening on your site. I could make up a thousand wrong URLs and get a thousand redirects, but it doesn’t mean anything.

    My concern would be that your site is returning 301 redirects for non-existent pages, which should return 404.

    yahiasylhety – did you have any luck tracing this?
    I’m having a similar problem. I have a multisite network:

    example.com
    example.com/issue001
    example.com/issue002
    example.com/issue003
    …etc…

    The parent site (example.com) returns 200 fine, but all of the subsites return 301, redirecting to themselves.

    Originally one of the subsites was reported as having malware by google. I upgraded everything to latest version and the malware seems to have gone (also checked the db and used a couple of exploit scanners), but I wonder if this 301 redirect is something that got left behind?

    I used the Google webmaster tools to do a “fetch as google” and I get this:

    The page seems to redirect to itself. This may result in an infinite redirect loop. Please check the Help Center article about redirects.
    HTTP/1.1 301 Moved Permanently
    
    Date: Wed, 12 Sep 2012 12:19:59 GMT
    Server: Apache/1.3.42 (Unix) Sun-ONE-ASP/4.0.2 Resin/2.1.13 mod_fastcgi/2.4.6 mod_log_bytes/1.2 mod_bwlimited/1.4 mod_auth_passthrough/1.8 FrontPage/5.0.2.2635 mod_ssl/2.8.31 OpenSSL/0.9.8e-fips-rhel5
    X-Pingback: https://example.com/issue001/xmlrpc.php
    X-Powered-By: PHP/5.3.15
    Location: https://example.com/issue001/
    Keep-Alive: timeout=15, max=100
    Connection: Keep-Alive
    Transfer-Encoding: chunked
    Content-Type: text/html; charset=UTF-8
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Htaccess 301 to 200’ is closed to new replies.