Home > Article > Backend Development > yii redirect, eliminate index.php_PHP tutorial
Add .htaccess under the project
The content is as follows:
deny from all
Options -Indexes
Options +FollowSymLinks
# For security reasons, Option followsymlinks cannot be overridden.
# Options +FollowSymLinks
# Options +SymLinksIfOwnerMatch
# IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule ^(.*)$ /hangman/index.php [L]
In the above content
/hangman/index.php after RewriteRule should be filled in according to the actual situation
It took me a long time to experiment before I succeeded. One night I suddenly had inspiration. Although the inspiration failed, it inadvertently opened up another path