Here the request code itself all works fine when access to the page is of the type or but gives an error when access is of the form of

Here is the code that pulls the user id

if (isset($_GET['id'])) {$id =$_GET['id']; } else { exit("Error 1 !");} if($id == 0) { exit("<p>Bad URL</p>"); } 

When requesting, it gives a bad url error. In .htaccess, this is what is entered for changing to idn

 RewriteEngine on RewriteRule ^([a-zA-Z0-9_-]+)$ profile?id=$1 RewriteRule ^([a-zA-Z0-9_-]+)/$ idn?id=$1 RewriteRule ^idn([0-9]+)$ profile?id=$1 

Tell me what's wrong and why does it give an error? What needs to be fixed?

  • The first condition is fulfilled in .htaccess RewriteRule ^ ([a-zA-Z0-9 _-] +) $ profile? Id = $ 1 - Alex Kapustin

1 answer 1

  RewriteRule ^idn([a-z0-9]+)$ profile.php?id=$1 [NC,L] 

So try it if I understand correctly!

  • does not help (It is necessary that the php code could determine the id of the request idn as well as the profile request? id = - OverLoader