Reputation:
So, i learned about mod_rewrite and decided to use it with my site, my old url was like this
https://xenonmc.tk/?paramOne=register
and heres the output i was supposed to get with mod_rewirte
https://xenonmc.tk/register
heres is my htaccess code
RewriteEngine On
RewriteRule ^([^/]*)$ /?paramOne=$1 [L]
I think ik the problem but i dont under stand how to fix it, even after viewing other articals on stackoverflow on this,
all i understood from thos is that [L] is causing my htaccess to loop again from the top causing the error.
Thanks for any support.
Upvotes: 0
Views: 727
Reputation: 133770
That's because you have an infinite loop getting created over there, we need to put a condition to avoid that(I am checking if query string is NULL then only run the rule by that no infinite loop), try:
Also please make sure you clear your browser cache before checking your URLs.
RewriteEngine ON
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^([^/]*)$ /?paramOne=$1 [L]
Upvotes: 2