Home > Backend Development > PHP Tutorial > How to configure route rewriting in tp under nginx

How to configure route rewriting in tp under nginx

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-09-22 08:56:51
Original
2080 people have browsed it

index.php/Api/Sendems/sendCode.html
这个路径,apache可以加载.htaccess,进行路由重写

Options +FollowSymlinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

那nginx要怎么配置路由重写呢

回复内容:

index.php/Api/Sendems/sendCode.html
这个路径,apache可以加载.htaccess,进行路由重写

Options +FollowSymlinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

那nginx要怎么配置路由重写呢

配置文件中增加

<code> rewrite  ^(.*)$  /index.php?s=$1  last;</code>
Copy after login
Related labels:
php
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template