i've used htaccess for something like this
domain.com/bacaberita.php -> domain.com/baca-berita
and i need passing get varible like this
domain.com/bacaberita.php?id=xy0001
how to hide the variable id so the url going to be domain.com/baca-berita/xyz0001
i'm using htacces code
RewriteRule ^baca-berita bacaberita.php
RewriteRule ^baca-berita/(.*) bacaberita.php?id=$1
but it throws id was empty
i've try this code only
RewriteRule ^baca-berita/(.*) bacaberita.php?id=$1
it work but the css and all images file can not called in the page
baca-berita/xyz0001already, so it gets rewritten tobacaberita.php. You need to anchor your pattern not only at the beginning, but at the end as well, if you want to avoid that.^baca-berita$, or^baca-berita/?$if you want to allow an optional trailing slash. And in general, you should keep your RewriteRules ordered from more specific to less specific.