Post by Goborijung at 2019-11-26 13:42:58 | ID: 188
// .htaccess :: Redirect 404 เป็น index.php ErrorDocument 404 /index.php
Post by Goborijung at 2018-12-24 10:10:17 | ID: 7
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]Post by Goborijung at 2018-12-24 10:11:44 | ID: 8
RewriteEngine On Redirect /product.php https://domain.com หรือ RewriteRule product.php https://domain.com
Post by Goborijung at 2018-12-24 10:12:18 | ID: 9
> ทดสอบว่า Mode_Rewrite ทำงานหรือไม่ ด้วยการทดสอบเปิดไฟล์ test.html จะต้องโดน Redirect ไปที่ google.com
RewriteEngine On
RewriteRule ^test.html http://www.google.com/? [R=301,L]
> Redirect www to non-www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
> Redirect non-www to www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]Post by Goborijung at 2018-12-24 10:09:44 | ID: 6
RewriteEngine On RewriteRule ^index.html$ index.php RewriteRule ^newname$ filename.php
Post by Goborijung at 2018-12-24 10:05:43 | ID: 4
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^.]+)$ $1.php [NC,L]Post by Goborijung at 2018-12-24 10:03:38 | ID: 3
RewriteEngine On DirectoryIndex index.php page-down.php
Post by Goborijung at 2019-11-26 13:41:53 | ID: 187
// .htaccess :: เปลี่ยน index.php ให้เป็น name/ RewriteEngine On RewriteRule ^name/$ index.php //ตรง name จะตั้งชื่อเป็นอะไรก็ได้
Post by Goborijung at 2018-12-24 10:08:24 | ID: 5
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^.]+)$ $1.html [NC,L]Post by Goborijung at 2020-06-06 09:07:39 | ID: 84
# http://domain.com/abc/product.php?i=1 to http://domain.com/abc/product/1 RewriteEngine on RewriteRule product/(.*)/ product.php?i=$1 RewriteRule product/(.*) product.php?i=$1