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.

Wordpress Login (wp-admin page redirect 404 page -maybe because of .htaccess problem)

Discussion in 'WordPress' started by avinashiitd, May 13, 2009.

  1. #1
    My Wordpress blog was running since a long time. And Everything was working right.
    The problem started 2 days ago. Something happened with .htaccess file.

    And now, my home page is working as usually, but when i try to go on page or a post, nothings work.

    I got a 404 error with this message:

    'The requested URL /my-page-or-post/ was not found on this server.

    Same error page comes when i even try to login to my wordpress admin page (/wp-admin).

    If i delete the .htaccess file, i can access admin page and home page but not individual posts pages.

    the post pages and homepage start working fine after i put .htaccess file back but admin page access is gone.

    heres my .htaccess file

    RewriteEngine on
    # -FrontPage-
    
    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
    
    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName avinashtech.com
    AuthUserFile /home/avinasht/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/avinasht/public_html/_vti_pvt/service.grp
    
    # BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteBase /
    AddDefaultCharset UTF-8
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]
    
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]
    </IfModule>
    
    # END WPSuperCache
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    RewriteCond %{HTTP_REFERER} !^http://avinashtech.com/.*$      [NC]
    RewriteCond %{HTTP_REFERER} !^http://avinashtech.com$      [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.avinashtech.com/.*$      [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.avinashtech.com$      [NC]
    RewriteRule .*\.(.*)$ - [F,NC]
    Code (markup):
     
    avinashiitd, May 13, 2009 IP
  2. .htaccess

    .htaccess Peon

    Messages:
    277
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Download new version of Wordpress, just upload the .htaccess file from that package to your server.
    All links will start working fine :)

    Just DISABLE WP-Supercache before doing all above stuff :)
     
    .htaccess, May 13, 2009 IP
  3. avinashiitd

    avinashiitd Peon

    Messages:
    184
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I dont think wordpress downloads contain any .htaccess file
     
    avinashiitd, May 13, 2009 IP
  4. .htaccess

    .htaccess Peon

    Messages:
    277
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If it is so, then use another .htaccess file from another wordpress installation. !!
     
    .htaccess, May 14, 2009 IP
  5. Ibn Juferi

    Ibn Juferi Prominent Member

    Messages:
    6,221
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    310
    #5
    Just recreate an empty .htaccess file, chmod it to 777 and log into your Dashboard to change the Permalinks settings. Should work after that. Disable all plugins before doing this however.
     
    Ibn Juferi, May 14, 2009 IP
  6. avinashiitd

    avinashiitd Peon

    Messages:
    184
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i did that but now i can only access wordpress wp-admin page and successful login too and homepage but cant access the post pages. I had to replcae back my old .htaccess file to make post pages accessible.
     
    avinashiitd, May 14, 2009 IP
  7. .htaccess

    .htaccess Peon

    Messages:
    277
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    0
    #7
    So problem solved ??
    If not then disable WP-Super cache plugin and reenable it.
    It will add its rules to that .htaccess file.
     
    .htaccess, May 14, 2009 IP
  8. avinashiitd

    avinashiitd Peon

    Messages:
    184
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    NO, i did as u said about super cache but problem persist.

    I have totally disabled supercahe for time being. i can access the site well .

    i had to check if everything goes well for few days atleast.
     
    avinashiitd, May 14, 2009 IP
  9. .htaccess

    .htaccess Peon

    Messages:
    277
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    0
    #9
    So,... by disabling the super cache now u r site working fine ?
    If yes... re enable it, it will write .htaccess file as per its req.
     
    .htaccess, May 14, 2009 IP
  10. avinashiitd

    avinashiitd Peon

    Messages:
    184
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I checked. Problem remains. I need to remove .htaccess file to access login page
     
    avinashiitd, May 14, 2009 IP