I have a simple code to make friendly urls, I put it below:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^acceder_usuario index.php?action=login
With this code, it would pass from an address of the type:
domain/index.php?action=login to an address domain/login_user
If, for example, I put something different to access_user , it gives an error as is logical and here I have 2 questions because I have tried everything and that is to do or verify that the total url is as it is and if not take actions.
For example, I see that if I put: URL/acceder_usuario?options=ok , the URL continues to work, which doesn't interest me, that is, if it couldn't load it would be ideal or it would be redirected elsewhere, given that otherwise it would have to be done through code php, I have tried all kinds of options in htaccess and none of them verify the total URL, so my idea would be that if, for example, the URL was not strictly URL/acceder_user, it would redirect to another side, or the typical error page would appear, which is which should come out type 404.
It happens that doing something with htaccess is quite confusing and you haven't just seen a manual where it explains things well, I also checked the official one and the truth is that there are things that are not well reflected.
That would be my question, a cordial greeting and thank you very much.
In order to use the value of the action variable in the get as a friendly url I have this:
To do it as you are doing it right now, that is, if the action variable is login, the url is access_user, you would have to make a line for each page to tell the htaccess to show according to what you put in the action.
In the way you have above, it would take the result of the action and display it as a url. By changing your action to action=acceder_usuario you would already have the same page url.
I hope it helps.