简体   繁体   中英

Why does my WordPress site have index.php in URL?

I am developing a website using WordPress. When you go to pages, it displays a index.php in the URL before the page name.

For example:

http://hci2018.bcs.org/index.php/register/

But it should be

http://hci2018.bcs.org/register/

How do I remove the index.php ?

Please change the Permalinks of the site:

  1. Go to Setting in the admin
  2. and click on the permalink
  3. Change the permalink to post name

You can get the exact URL as you want.

I have had the same problem. After enabling permalink to post name, all my pages (other than the homepage) came up as not found (404). This happened because the .htaccess file couldn't be modified by Wordpress. I had to manually edit/modify the .htaccess file from the root folder of the website with the following:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>

After I did this, everything worked as before. And no more index.php before the page name. Problem solved!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM