Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to remove index.php from wordpress

2025-03-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how wordpress removes index.php. I hope you will get something after reading this article. Let's discuss it together.

Wordpress remove index.php method: first log in to the wordpress background; then select "set-fixed link" and set the link; then set wordpress rewriting rules; finally, create a new htaccess file under the wordpress website directory.

Wordpress's method of getting rid of index.php

There are two main steps:

1-1) wordpress settings permalink

Log in to the wordpress backend

Select 'Settings / fixed links' in turn

On the page that appears

Select Custom structure

And then, according to your situation,

Set up the link.

1-2) set wordpress rewriting rules

This needs to be decided according to your web server

1-2-1) wordpress apache static link rewriting rules

If you are apache

Under the wordpress website directory

Create a new .htaccess file

And write the following code

RewriteEngine OnRewriteBase / wordpress/RewriteRule ^ index\ .php $- [L] RewriteCond% {REQUEST_FILENAME}!-fRewriteCond% {REQUEST_FILENAME}!-dRewriteRule. / wordpress/index.php [L]

1-2-2) wordpress nginx static link rewriting rules

If your web server is nginx

Edit nginx's configuration file nginx.cnf

In the server {} configuration content

Write the following code

Location / {if (- f $request_filename/index.html) {rewrite (. *) $1/index.html break;} if (- f $request_filename/index.php) {rewrite (. *) $1 request_filename index.php;} if (!-f $request_filename) {rewrite (. *) / index.php;}

Then restart nginx

This removes the index.php from the wordpress link.

After reading this article, I believe you have some understanding of "how to remove index.php from wordpress". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report