Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save minhphong306/fe6d2e79c750253b5ae9750653b562c5 to your computer and use it in GitHub Desktop.
Save minhphong306/fe6d2e79c750253b5ae9750653b562c5 to your computer and use it in GitHub Desktop.
Combo .htaccess cho việc chuyển đổi thư mục root cho tên miền gốc
RewriteEngine On
RewriteBase /
# Thay cái /webapp bằng thư mục bạn muốn chuyển
RewriteCond %{THE_REQUEST} /webapp/([^\s?]*) [NC]
RewriteRule ^ %1 [L,NE,R=302]
# Thay cả ở đây nữa nhá
RewriteRule ^(.*)$ webapp/index.php?$1 [L,QSA]
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L,QSA]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment