i have touble for my .htaccess config., this is part of config:
RewriteCond %{QUERY_STRING} ^token=(.*)
RewriteRule ^aplikasi/(.*).asp aplikasi.php?halaman=$1&token=%1
and result that config is:
http://{domain}/aplikasi/{$1}.asp?token={%1}
if i using this link:
http://{domain}/aplikasi/{$1}.asp
i have 404 error, i my question is : how to create like that with optional token prameter (i want to "?token={%1}" is optional)
You have two possibilities.
token
RewriteCond %{QUERY_STRING} ^$ [OR]
RewriteCond %{QUERY_STRING} ^token=([^&\s]+)$ [NC]
RewriteRule ^aplikasi/(.+)\.asp$ /aplikasi.php?halaman=$1&token=%1 [L]
RewriteRule ^aplikasi/(.+)\.asp$ /aplikasi.php?halaman=$1 [L,QSA]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With