How to clean url wordpress

I’m using wordpress for a site,

this url before tes.com/index.php/about/
i want url like this tes.com/about/

Read More

I have tried copying parts of WordPress’ .htaccess, however shows a 404 error.

My .htaccess file looks like:

# 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

Any ideas on where to start and how to accomplish what I’m looking for?

Related posts

3 comments

  1. Go to your WP-ADMIN–>Settings–>Permalink and use the permalink structure change there, if it generate any .htaccess file copy the content and update your .htaccess file.

    Or Check if your hosting mod_rewrite is enable by creating a file phpinfo.php with content,

    Upload this file and browse via Browser. So you know which modules are enabled. You need mod_rewrite enable to remove index.php from URL.

  2. Try this –

    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /test.com/
      RewriteRule ^index.php$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /test.com/index.php [L]
    </IfModule>
    
  3. The official instructions will give you clean urls. So best to follow this

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    

Comments are closed.