WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Wamp -WordPress configured correctly - Permalinks still won't work? (18 posts)

  1. xfreespiritx
    Member
    Posted 8 months ago #

    I followed this to install wordpress on wamp.

    http://make.wordpress.org/core/handbook/...

    I enabled the required functionality in Wamp by navigating to the httpd.conf file and uncommented the line LoadModule rewrite_module modules/mod_rewrite.so by deleting the hash at the front of the line. Then I scrolled a bit further down, found the line "Options FollowSymlinks" and changed the second line in that section from "AllowOverride none" to AllowOverride all. I saved and restarted wamp.

    It appears that WordPress creates an .htaccess file automatically in the wp folder and this is its contents:

    # 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

    I start with permalinks set as default, then set permalinks http://localhost//%postname%/ . I get the message Permalinks succeeded, but when I visit site it says

    "Not Found
    The requested URL /about/ was not found on this server."

    In terms of setting permissions by chmodding .htaccess, I am on a windows 7 and used FileZilla on the advice of a number of contributors here, but I suspect everyone owns a Mac or unix based system or something cos they all say the same thing! If i try to change the permissions using filezilla, I get the "504 command not implemented for that parameter" message. I have since learned that windows already allows for such permissions anyway.

    Does anyone know what I am missing here?

  2. Jesin A
    Member
    Posted 8 months ago #

    First check if the .htaccess file is working by adding the following line.

    deny from all

    You should get a 403 error now. If you do remove this line and proceed.

    Just to make sure if mod_rewrite was enabled comment out the IfModule lines like this

    # 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

    Then access your site, if you get a "500 Internal Error" it means mod_rewrite isn't enabled.

  3. xfreespiritx
    Member
    Posted 8 months ago #

    Hi Jesin,

    Thank you for answering, forgive my ignorance, I am a total noob at all of this but really really appreciate your help.

    Do I add "deny from all" to the httpd.conf file or the .htaccess file that is created by wordpress in the wp folder?

  4. Jesin A
    Member
    Posted 8 months ago #

    We are checking if the .htaccess file is able to override the main configuration file. So you add that to the .htaccess file.

  5. xfreespiritx
    Member
    Posted 8 months ago #

    I place it Before "RewriteEngine" and after "Rewrite Rule" and my webpage loaded.

  6. Jesin A
    Member
    Posted 8 months ago #

    Place it as the first line above # BEGIN WordPress.

  7. xfreespiritx
    Member
    Posted 8 months ago #

    OK. Located .htaccess fille in WP directory. And modified like this.

    Deny from all

    # 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

    Website Opens! means that file is not over-riding main .htaccess file right? Where is the main .htaccess file in wamp?

  8. Jesin A
    Member
    Posted 8 months ago #

    Yes you're right.

    There is no "main" .htaccess file. Check the httpd.conf file. Open this file, find all instances of "AllowOverride" and make sure they have "All".

    Also there should NOT be a # before "AllowOverride All".

  9. xfreespiritx
    Member
    Posted 8 months ago #

    Ok. Done. Now have 403 error..!

    followed previous instruction and removed deny all from .htaccess
    then commented out <IfModule to test mod rewrite enabled or not. No 500 Internal Error, my webpage loaded so mod-rewrite must be enabled which I know it was. So now testing Permalinks.

  10. Jesin A
    Member
    Posted 8 months ago #

    Then permalinks must be working now.

  11. xfreespiritx
    Member
    Posted 8 months ago #

    OMG!!!!!! Permalinks works, they work, thank you, thank you, thank you Jesin! I have been trying to work this out FOREVER... Thank you.

  12. Jesin A
    Member
    Posted 8 months ago #

    Great to hear that!!! You're welcome...

    So to conclude it looks like the httpd.conf file had a # before AllowOverride All.

    Putting a # before a line comments it out so the .htaccess file wasn't considered at all.

  13. xfreespiritx
    Member
    Posted 8 months ago #

    No, I did have AllowOverride All as uncommented, ie hash removed, but "AllowOverride" search and replace all instances 'None' with 'All' throughout httpd did it.

    These additional instances were changed as a result

    <Directory />
    AllowOverride none
    Require all granted
    </Directory>

    further down... this was changed as well.

    <Directory "C:/wamp/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
    </Directory>

  14. xfreespiritx
    Member
    Posted 8 months ago #

    Are there any security considerations or is this config ok?

  15. Jesin A
    Member
    Posted 8 months ago #

    Not at all if this is your local testing WAMP server.

    Which "AllowOverride" did you modify earlier? It should be the one in

    <Directory "C:/wamp/www">
    AllowOverride All
    </Directory>
  16. xfreespiritx
    Member
    Posted 8 months ago #

    Yes, that's the one! But on its own, permalinks didn't work. When I did the search and replace throughout the httpd, then it worked.

  17. karenbatten
    Member
    Posted 7 months ago #

    Sorry to ask a simple question but where do I find httpd in cpanel?
    I have been trying everything to get permalinks to work but it will only stick to default. I'm thinking I need to edit the httpd file.

  18. Jesin A
    Member
    Posted 7 months ago #

    Are you on shared hosting? If so you cannot edit such files.

    Please open a new topic as this thread deals with a self hosted WAMP environment and also this topic is resolved.

    In the new topic mention the contents of the .htaccess file.

Reply

You must log in to post.

About this Topic