8 responses

  1. Muhammad Usman
    January 20, 2012

    Thanks man it’s great info. I was searching for it but could not found anywhere finally i found it here. :)

  2. Anson
    June 14, 2012

    Hi Harsh,

    I just screwed up with my .htaccess file… :( can you please help me?

    I was using %postname% as the permalink and recently i used one plugin (Page Links To) to change the permalink to redirect one of the pages in my website to a subdomain but it didn’t work due to some domain issue..but thats ok now I don’t want to link to subdomain. I just wanted the earlier permalink (mydomain.com/%postname%) but what happens is get the 404 page not found error when i link to the earlier url. I tried changing the permalink multiple times…

    I think something would have got changed when i used the plugin. I have uninstalled the plugin and tried to access the page still the same error. But I can see the page in my wordpress admin page with the old url and when I click on ‘view page’ it gives 404 error.

    I have checked my .htaccess file and it seems there is a problem. Below is my .htaccess after the plugin was installed.

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

    After going through different posts I have changed i to:

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress (Basically I removed the- — ‘RewriteRule ^index\.php$ – [L]‘)

    But as per your post below is the .htaccess

    # BEGIN WordPress

    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    (I hope its for %postname% and not the default one) But its missing the
    (RewriteEngine On
    RewriteBase / ) and Includes
    ( RewriteRule ^index\.php$ – [L]) when compared to both the .htaccess what I have tried.

    I’m confused which one should I use out of all these three. I don’t remember what was my original .htaccess.. :( before all these goofups happen. But I was using %postname% permalink.

    I think you will be able to help out with this…I had gone through some of your posts and I feel you are expert in wordpress.
    I would really appreciate your help . I just want to my missing page should be appeared on the website as it was before with the old url (ie. Mydomain.com/%postname%)
    Is this possible or do I need to republish the page with a different url as a new page and use 301 redirect? (But I don’t prefer 301 redirect..)
    Sorry that I have written too much but I hope you understand my issue. Looking forward to your reply. Thanks a lot

  3. Steve B
    April 14, 2013

    I have tried your editing tips using your suggested code as written and it has shut my site down every time! What am I doing wrong?

    • Harsh Agrawal
      April 17, 2013

      @Steve
      Are you using FTP method? Can you share the code which you are adding, usually it happens when code is wrong in .htaccess file.

      • steve b
        April 17, 2013

        I finally got it! I don’t know what the problem was though. Thanks

  4. altaf
    August 12, 2013

    respected all i ask a question on my site up-to 500 pages i read on google …..
    the google xml sitemap submit work only 500 pages but my website pages is over up to 500 what can i do kindly please giv me sudgession

  5. Mukul Bansal
    January 25, 2014

    Installed Robot Meta Plugin and successfully edited my .htaccess file for my blog … Learned the other ways to update htaccess file on my blog … Thank you harsh for writing such a informative post

  6. Sunil Prajapati
    February 12, 2014

    Hello Sir,
    I am Sunil Prajapati. As you wrote above, i did as well but my permalink yet not changed. It is now 404 error showing. Please tell me now what can i do…..

Leave a Reply

 

 

 

Back to top
mobile desktop