I have a problem with my Wordpress permalink. I tried to change permalink to postname "/%postname%/"
. When I test one of my page, its says that 404 Not Found
.
I've looking around about my problem and tried many tutorials but no luck. In my opinion, my Wordpress access seems not working but I'm not sure because I'm newbie for this. Please anyone can help me solve this problem.
Thanks In Advance
Try replacing your .htaccess
with default .htaccess
# 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
Make sure you backup your .htaccess
before using this.
If your .htaccess file were writable, WordPress will do this automatically, but if it isn't- these are the mod_rewrite rules you should add in your .htaccess file.
1- Open .htaccess file and copy the following data in that file.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
- After updating the file the permalink issue will resolve.
Please check you .htaccess must look like below if not remove all code and write below:
# 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
After that run below command:
1 EDIT (Change None to all)
sudo vim /etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
To (press i to edit)
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
save (press :wq!)
sudo a2enmod rewrite
sudo service apache2 restart