Php 如何在Apache中重写简单的URL?
如果我有这样一个URL: 如何消除/web/index.php,使其成为Php 如何在Apache中重写简单的URL?,php,.htaccess,mod-rewrite,yii2-basic-app,s3-rewrite-rules,Php,.htaccess,Mod Rewrite,Yii2 Basic App,S3 Rewrite Rules,如果我有这样一个URL: 如何消除/web/index.php,使其成为http://localhost/sewacp 我写过。htaccess是这样的,但不起作用: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . web/index.php 试着按照规则来做 RewriteEngine On RewriteRule ^$ /sewac
http://localhost/sewacp
我写过。htaccess是这样的,但不起作用:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . web/index.php
试着按照规则来做
RewriteEngine On
RewriteRule ^$ /sewacp/web/index.php [QSA,L]
很有效,谢谢