SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Internet Business Optimizer KCgame's Avatar
    Join Date
    Mar 2005
    Location
    Singapore
    Posts
    928
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question 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

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Is the .htaccess file correct? Doesn't seem so.
    Saul

  3. #3
    Internet Business Optimizer KCgame's Avatar
    Join Date
    Mar 2005
    Location
    Singapore
    Posts
    928
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by php_daemon View Post
    Is the .htaccess file correct? Doesn't seem so.
    Hi, may I know what is the correct .htacess format?

  4. #4
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    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:

    Code:
    # 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
    Saul

  5. #5
    Internet Business Optimizer KCgame's Avatar
    Join Date
    Mar 2005
    Location
    Singapore
    Posts
    928
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by php_daemon View Post
    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:

    Code:
    # 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:

    Code:
    # 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..

  6. #6
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You have RewriteEngine off under the WP rules, it turns off mod_rewrite.
    Saul

  7. #7
    Internet Business Optimizer KCgame's Avatar
    Join Date
    Mar 2005
    Location
    Singapore
    Posts
    928
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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!

  8. #8
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    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.
    Saul


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •