Permalinks not working other than default settings?

Hi,

I have a site that I change the permalinks to /%post_id%/%postname%/

but all other pages (other than home page) cannot be loaded after the setting. They give me a page not found error… Once I change the permalinks back to the default settings, I can then load the pages.

Anyone knows how to fix this issue? The site is at: my-excelservices.com | EXCELLENT SERVICES

Is the .htaccess file correct? Doesn’t seem so.

Hi, may I know what is the correct .htacess format?

Usually WP updates the file when you turn on permalinks. If for some reason it can’t update the file automatically, it gives you the code to add to .htaccess manually.

The code is:


# 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

Hi,

Thank you for your advice. It seems that my .htaccess file is correct. But it still gives me a 404 error with the following .htaccess codes:


# 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
RewriteEngine off
<IfModule mod_suphp.c>
	suPHP_ConfigPath /home/myexcel3/public_html/php.ini
	<Files php.ini>
		order allow,deny
		deny from all
	</Files>
</IfModule>


This is so strange…

You have RewriteEngine off under the WP rules, it turns off mod_rewrite.

Thank you! The problem has been fixed!

The issue is that WP can’t overwrite the .htaccess file so I deleted it and let WP create a new one by selecting the new Permalinks again =)

Problem solved!

Yes, but the old .htaccess was there to hide your php.ini, now it’s publicly accessible - not good. If you just moved the WP code to the end of the file, or removed the ‘RewriteEngine off’ line, it would both work.