I'm trying to create pretty permalinks through WordPress and I keep getting 404 errors. I've scoured the internet and I can't find any solution. I've never had an issue with this before so I'm totally stumped.
The hosting is under Network Solutions. I called them and they sent me this link: http://www.networksolutions.com/support/PHP-ini-for-UNIX-Shared-Hosting-FAQ
What I've tried: 1. Adding a php.ini file to my root. 2. Adding a php.ini file to the cgi-bin folder 3. Adding the rewrite commands to my .htaccess file (which is located in the root of my website).
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /stage/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /stage/index.php [L]
</IfModule>
# END WordPress
After each of these, I've resaved the permalink settings to flush the changes.
I still keep getting a 404 error.
Another common cause of WordPress slug not working is a conflict with your theme or plugin. To fix this, you need to deactivate all plugins and switch to the default WordPress theme (Twenty Sixteen). Once you've done that, check to see if your WordPress slug is working.
Switch the Permalinks Setting This is where you go to your WordPress Dashboard → Settings → Permalinks. Then, you need to choose Post Name and click on the button Save Changes. Yes, that's all.
I had the same problem on an Ubuntu 14.04 server which is running as a staging server. In this case the rewrite module was not enabled by default; so Pagination and "non-ugly" Permalinks were not working (as they rely on .htaccess rewrite rules to work).
You have to edit the Apache conf file (in Ubuntu 14.04: /etc/apache2/apache2.conf) and change the AllowOverride setting from None to FileInfo
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride FileInfo
Require all granted
</Directory>
You may need to enable the Rewrite module:
sudo a2enmod rewrite
and to complete you will need to restart
sudo service apache2 restart
That's been bugging me for a month or so, now, so kudos to the solution found: https://askubuntu.com/questions/48362/how-to-enable-mod-rewrite-in-apache
Login to your server using FTP, and modify the .htaccess file which is located in the same location where folders like /wp-content/ and /wp-includes/ are located. The easiest thing you can do is to temporarily make the file writeable by changing the permissions to 666. Then repeat the original solution. Don’t forget to change the permissions back to 660. You can also manually add this code in your .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
Another solution: Put index.php at the start of your custom permalink structure, for example:
/index.php/%year%/%monthnum%/%day%/%postname%/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With