Title: Cannot Remove index.php from URL
Last modified: January 5, 2018

---

# Cannot Remove index.php from URL

 *  [Urantian](https://wordpress.org/support/users/urantian/)
 * (@urantian)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/cannot-remove-index-php-from-url/)
 * Greetings,
 * I host several WP sites on my server, and each one will not suppress index.php
   in the URL. If I attempt to navigate to a page without it, I get a 404 error.
 * The .htaccess file normally contains this (default):
 *     ```
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
       RewriteRule ^index\.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
       ```
   
 * I have tried setting the permalinks to /%postname%/ with the following in .htaccess,
   based on doing some searching.
 *     ```
       <IfModule mod_rewrite.c>
       RewriteEngine on
       RewriteBase / 
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule ^/(.*)$ /index.php/$1 [NC,L]
       </IfModule>
       ```
   
 * However, this still results in 404 errors. It is as if the .htaccess file is 
   being ignored.
 * Also, .htaccess does not get updated following any permalink changes from within
   WP. I am not sure whether it should be updating. The permissions are 644 and 
   is owned by the account username.
 * Thank you,
 * Michael Reynolds
    -  This topic was modified 8 years, 4 months ago by [bdbrown](https://wordpress.org/support/users/bdbrown/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [kjodle](https://wordpress.org/support/users/kjodle/)
 * (@kjodle)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/cannot-remove-index-php-from-url/#post-9838230)
 * Is that the _entire_ contents of the .htaccess file? If there is something else
   after that, those rules will supersede the earlier ones.
 * > The permissions are 644 and is owned by the account username.The permissions
   > are 644 and is owned by the account username.
 * The file should be owned by the same owner that is running Apache.
    -  This reply was modified 8 years, 4 months ago by [kjodle](https://wordpress.org/support/users/kjodle/).
      Reason: typofix
 *  Thread Starter [Urantian](https://wordpress.org/support/users/urantian/)
 * (@urantian)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/cannot-remove-index-php-from-url/#post-9838264)
 * Below is the entire .htaccess file contents. The server uses cPanel.
 * Michael Reynolds
 *     ```
       # 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
       # php -- BEGIN cPanel-generated handler, do not edit
       # Set the “ea-php56” package as the default “PHP” programming language.
       <IfModule mime_module>
         AddType application/x-httpd-php .php .php5 .phtml
       </IfModule>
       # php -- END cPanel-generated handler, do not edit
   
       # BEGIN cPanel-generated php ini directives, do not edit
       # Manual editing of this file may result in unexpected behavior.
       # To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
       # For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
       <IfModule php5_module>
          php_flag asp_tags Off
          php_flag display_errors Off
          php_value max_execution_time 30
          php_value max_input_time 60
          php_value max_input_vars 1000
          php_value memory_limit 128M
          php_value post_max_size 8M
          php_value session.gc_maxlifetime 1440
          php_value session.save_path "/var/cpanel/php/sessions/ea-php56"
          php_value upload_max_filesize 2M
          php_flag zlib.output_compression Off
       </IfModule>
       # END cPanel-generated php ini directives, do not edit
       ```
   
 * _[Moderator note: code fixed. Please wrap code in the backtick character or [use the code button](https://make.wordpress.org/support/handbook/forum-welcome/#post-code-safely).]_
    -  This reply was modified 8 years, 4 months ago by [bdbrown](https://wordpress.org/support/users/bdbrown/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Cannot Remove index.php from URL’ is closed to new replies.

## Tags

 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)
 * [index.php](https://wordpress.org/support/topic-tag/index-php/)
 * [permalinks](https://wordpress.org/support/topic-tag/permalinks/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Urantian](https://wordpress.org/support/users/urantian/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/cannot-remove-index-php-from-url/#post-9838264)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
