A
A
Alexander Bagirov2014-09-08 16:45:15
PHP
Alexander Bagirov, 2014-09-08 16:45:15

How does the profile display system work?

Good evening!
each
We have a social network in which people are registered, each has an id / nickname.
To open a profile, we use the profile.php file, that is, we get something like profile.php? id=1. How does such a scheme work and how can it be implemented through ModRewrite (am I right that only he is needed here?)?
How can I do with ModRewrite the option when profiles open at the address of the form site.ru/users/nickname?
Thanks for answers!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2014-09-08
@alexbagirov

In your case it would be something like

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^users/(.*)$ profile.php?id=$1 [L]

More examples

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question