Question

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.

Was it helpful?

Solution 2

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%/

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top