ホームページ  >  記事  >  バックエンド開発  >  nginx で tp でルート書き換えを設定する方法

nginx で tp でルート書き換えを設定する方法

WBOY
WBOYオリジナル
2016-09-22 08:56:511977ブラウズ

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>
声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。