I want to hide the query strings of the url, so I know if the url has the query and only get the value of the query.
Let's say this is my url:
http://miurl.com/?query=valor
And I want it to be modified in this way:
http://miurl.com/valor
But that does not allow in any way the url has the query as in the first example. What I mean is to create friendly urls, and if a query is detected in the url it will automatically redirect it to the url with only the value of the query.
Let's say we write the url like this:
http://miurl.com/?query=valor
And redirect to:
http://miurl.com/valor
Now the question is, how can I achieve it with htaccess?
My htaccess file:
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*)$ /?query=$1 [L,NC]