Permalinks in Wordpress - Page not found

前端 未结 6 677
误落风尘
误落风尘 2021-01-01 03:29

I\'ve been searching for hours but haven\'t found anything that seems to be able to solves this issue.

Here\'s the scenario:

I\'m making a wp theme based on

相关标签:
6条回答
  • 2021-01-01 04:05

    If editing apache2's default configuration and Wordpress' .htaccess files don't help the reason could simply be that apache2's rewrite module is not enabled. This is usually the case for those who install apache2 themselves. Wordpress needs apache2's rewrite module enabled to support permalink edits. If, like me, you'd rather not edit conf files by hand, apache2's rewrite module can be enabled by running these commands as root (I'm using Ubuntu 18.04 but I'm sure the commands aren't different for other distros):

        a2enmod rewrite
    

    and restart the apache2 service by running:

        systemctl restart apache2
    

    or

        service apache2 restart
    

    If you're running Ubuntu 18.04, you can check out all available apache2 modules under /etc/apache2/mods-available and see what modules are enabled by listing the files under /etc/apache2/mods-enabled.

    0 讨论(0)
  • 2021-01-01 04:17

    There are two 'Directory' sections in the httpd.conf file. One is for root folder and another for htdocs folder. You must edit both fields to make WordPress pages work again. Hope it helps.

    0 讨论(0)
  • 2021-01-01 04:18

    I don't know if you have found the solution to it, but I solved this problem by simply turning on LoadModule rewrite_module modules/mod_rewrite.so in httpd.conf file.

    0 讨论(0)
  • 2021-01-01 04:22

    This worked for me like @Skillachie wrote BUT be also sure to include those settings in the 000-default-SSL.conf file if you use SSL!

    <Directory /var/www/PATH>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
    </Directory>
    
    0 讨论(0)
  • 2021-01-01 04:25

    For those using apache. You will need to

    1. Ensure you have .htaccess in root path of the site you are hosting. Example /var/www
    2. Update the /etc/apache2/sites-available/default

    From

    <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
    

    To

    <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
    

    Hope this helps someone

    0 讨论(0)
  • 2021-01-01 04:25

    Also see Permalinks on WordPress (Amazon EC2)

    I had the same problem, but the author in the above link suggested to do three things (it worked for me!):

    Go to /etc/httpd/conf and edit httpd.conf

    <Directory />
        Options FollowSymLinks
        AllowOverride All
    </Directory>
    

    Change also AllowOverride if it is set to None

    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
        AllowOverride All
    

    I you haven’t created it yet, place in the root directory of your wordpress installation a .htaccess file with the following 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
    
    0 讨论(0)
提交回复
热议问题