Mr.Đức Weblog

Archive for the ‘Apache2’ Category

18 thủ thuật cho mod rewrite

Posted by: mrduc on: July 8, 2008

Rewrite Engine
Basic Redirect
HTML to PHP
Remove File Extensions
Add WWW To Domain
Remove WWW From Domain
Add Trailing Slash
Remove Trailing Slash
Remove Query String
Remove Trailing Question Mark
Remove Trailing Index File
Remove Index File From URL
HTTP to HTTPS
HTTPS to HTTP
Deny Access To Htaccess
Enable Caching
Disable Caching On Dynamic Pages
Example Htaccess File

http://www.crucialwebhost.com/blog/htaccess-apache-rewrites-oh-my/

Kích hoạt Mod rewrite trong Ubuntu

Posted by: mrduc on: July 8, 2008

Để sử dụng mod rewrite của apache trong ubuntu trước tiên bạn cần
kích hoạt module rewrite bằng cách vào Applications — > Accessorices –> Terminal gõ lệnh:

$ sudo a2enmod rewrite

Tiếp đó mở file : /etc/apache2/sites-enabled/000-default
và sửa lại dòng
AllowOverride None thành AllowOverride All
chú ý : có thể sửa tất cả các dòng None thành All hoặc [...]



  • None

Categories