I have a rule .htaccess
that allows the data to be displayed despite the user manipulating or modifying the categories.
Example if the user visits the following address:example.com/categoria/otracategoria/mi-url/
And you can modify it as follows:example.com/categoria/cat/plus/mi-url/
The data will be displayed in the same way, the detail of that product will be displayed without errors, except if you modify this mi-url
there, the system displays the following message: the product does not exist.
I don't know, if it is correct to leave it as it is, I don't think it is insecure, in SEO, only the URL
, which are correctly in the system, will be indexed, so I would believe that there is no problem with it.
But on the other hand, I think that it would look better if the data were displayed in the URL
correct one.
So getting the url of the column recordsurl
id url
1 cat/1/producto/mi-url/
Through a named variable $urlcorrecta
and through a certain condition if that variable does not match the UR web path direct to the url
true/correct one.
For example, if this is the url
correct one, and if the URLexample.com/cat/1/producto/mi-url/
is manipulated like this: and that through PHP, when checked, it is directed to the true URL :example.com/cat/otro/1/mi-url/
example.com/cat/1/producto/mi-url/
How can I implement this check?
You can check if the url is the one you expect in
php
and if it is not, redirect to the correct one with a301
.