How to make a different site path? For example, a person with id = 1 goes to his page.php page.
Then the line will say http: //..../page.php, and how to make it be written http: //..../id=1
- I feel tsu mod rewrite is needed, look in google - tranceman
2 answers
Create a file in the /page/index.php
folder, add the line to page.php
:
header('location: /page/?id='.$id);//где $id нужный вам идентификатор
Then in the file /page/index.php
you can safely handle the $_REQUEST['id']
variable $_REQUEST['id']
. But I dare to say, it all smacks of perversion, explain your problem more specifically, and then get a more competent answer.
If I understand you correctly, do you need CNC?
then apache mod_rewrite to help ...
the .htaccess file is exactly your example:
RewriteEngine = On # Turn on mod_rewrite RewriteRule ^ page / id ([0-9] +) $ /page.php?id=$1 # The mode_rewrite itself in action
the regular parse on the left is the URL entered by the user and puts the value in $ 1; the second calls the php script page.php and passes the $ _GET ['id'] parameter
If I understand you correctly, then something like that. I wanted to add - the rule will work only when a numeric value is entered after id, which is also quite convenient.