Thursday, August 6, 2015

Hướng dẫn làm ẩn index.php trên Yii 2.0


Làm ẩn index.php trên trang web tưởng chừng đơn giản.nhưng có nhiều người chưa biết.
Sau đây mình hướng dẫn làm ẩn index.php trên yii2 php framework.
Các bạn phải kích hoạt chế độ mod_rewrite trên hosting hoặc pc của mình, và sau đó tìm đến thư mục website của bạn và sửa file .htaccess

sau đó copy paste:
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 . index.php

0 comments:

Post a Comment