简体   繁体   中英

wordpress 404 page not found permalinks

i have change my wordpress Permalink Settings Default http://localhost/mywebsite/?p=123 to Post name http://localhost/mywebsite/sample-post/ .

then i create a page. its not working. 404 page not found.

have any solution for this with out plugin .

Thank You

resolved

This problem in local host. so we nee to turn on rewrite module in Apache.

so If you are using XAMPP or WAMP package then you will find the file at:

{xampp_dir}/apache/conf/httpd.conf

{wamp_dir}/apache/conf/httpd.conf

Search for the following string:

#LoadModule rewrite_module modules/mod_rewrite.so

remove the '#' sign

restart wamp , xamp

转到设置-> 固定链接设置-> 再次选择单选按钮并单击保存按钮

You can check if there exist an htaccess file in your WordPress home directory as shown above. If it is not there create one:

$ sudo nano /var/www/html/.htaccess

and copy paste the below to it

# 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

Press ctrl+x and press y to save the file. And restart apache by

$ sudo service apache2 restart

You would want to tell apache to follow your .htaccess file. You can do this by editing the apache.conf file

$sudo nano /etc/apache2/apache.conf

Scroll down to the line By default it will be:

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

change the value of AllowOverride to All so now it becomes:

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

Press ctrl+x and press y to save the configuration file. In order to make this changes to server first enable the mod_rewrite by.

$ sudo a2enmod rewrite

And then restart the server

$ sudo service apache2 restart

Done!

Source: https://www.wst.space/riddling-with-wordpress-permalink-setup-issues/

If anyone else facing this problem.

Make sure you have the write access while changing permalink settings. Check if you have .htaccess file and the following content exist:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM