Rewrite URL แล้วปิดใช้ URL ที่ไม่ได้ rewrite ทำยังไง?

เริ่มโดย Hanuman, 29 มกราคม 2015, 10:45:27

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

Hanuman

Rewritten URL: http://localhost/benchapon/category/1

จะปิดใช้งาน URL นี้ ให้ redirect ไปหน้าแรกหรือ ขึ้นว่า error 404 ยังไงครับ

Original URL: http://localhost/benchapon/index.php?category=1.0 < ปิดใช้งาน

ผม rewrite แบบนี้

RewriteEngine On
RewriteRule ^action/([^/]*)$ /benchapon/index.php?action=$1 [L]
RewriteRule ^category/([^/]*)$ /benchapon/index.php?category=$1 [L]

thaisew


Hanuman

อ้างถึงจาก: thaisew ใน 29 มกราคม 2015, 11:47:35
ErrorDocument 404 /404.php

อันนี้คือ redirect error 404 ไปที่หน้า 404.php ใช่ป่ะครับ

คือตอนนี้ URL นี้ยังใช้ได้และผมต้องการจะปิดมันครับ http://localhost/benchapon/index.php?category=1.0

ให้มันเข้าได้ทางเดียว http://localhost/benchapon/category/1