• I have setup my first AWS EC2 account and installed nginx. The root is /usr/share/nginx/html. I have installed WordPress as a sub-folder called cooking under root. the site address is http://54.226.50.133/cooking.

    As long as I have permalink setup as Plain, pages are coming up ok, but when I update permalink structure to use Post Name, I get 404 error.

    http://54.226.50.133/cooking/?p=1 – runs OK
    http://54.226.50.133/cooking/hello-world/ – gives 404

    Physical folder structure: /usr/share/nginx/html/cooking

    Location of .htaccess file is /usr/share/nginx/html/cooking/.htaccess

    Content of .htaccess file:

    
    # 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 am not sure but multisite might be a solution but I don’t want to go this far to start with, rather I want to keep it simple. I will need more sub-folders (different WP installations) like this under the root for demonstration purpose.

    What I am doing wrong?

    • This topic was modified 8 years, 9 months ago by Jan Dembowski.
    • This topic was modified 8 years, 9 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Nginx doesn’t parse .htaccess file!

    If you use Apache somewhere in your server stack, read on…

    We can have different rewrites when we serve WP from a sub-folder. Please try the following…

    <IfModule mod_rewrite.c>
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /cooking/index.php [L]
    </IfModule>

Viewing 1 replies (of 1 total)

The topic ‘Post name Permalink gives 404 error’ is closed to new replies.