ala888 Posted December 23, 2014 Share Posted December 23, 2014 Usually, websites pass in get requests in the url with ? e.x. youtubes:/watch?v=S1B2lUbPKwA but sometimes, I also see urls like: http://www.reddit.com/user/HeirOfTheSurvivor how are they doing the /user/HeirOfTheSurvivor part? I dont believe its a url rewrite, but what could it be? Link to comment Share on other sites More sharing options...
Ingolme Posted December 23, 2014 Share Posted December 23, 2014 Yes, that's URL rewriting. Link to comment Share on other sites More sharing options...
ala888 Posted December 23, 2014 Author Share Posted December 23, 2014 if its url rewrite, how are they passing the HeirOfTheSurvivor username to what I presume to be user.php? Link to comment Share on other sites More sharing options...
Ingolme Posted December 23, 2014 Share Posted December 23, 2014 My guess is that they redirect any URL that doesn't link to an existing file or folder to the same PHP file (probably named index.php) In that PHP file they read the value of $_SERVER['REQUEST_URI'], break it into the pieces they need (with explode(), for example) and use the information to determine which files and database records to show. (using include or require to load files, and those files load data from the database) That's assuming they're using PHP. If it's not PHP then they'd have other ways to determine what's in the URL. Link to comment Share on other sites More sharing options...
ala888 Posted December 23, 2014 Author Share Posted December 23, 2014 oh thanks man, that clears it up alot! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now