user14509722
user14509722

Reputation:

Mod rewrite causing internal server error, error 500

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.

enter image description here

Thanks for any support.

Upvotes: 0

Views: 727

Answers (1)

RavinderSingh13
RavinderSingh13

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

Related Questions