Mobile app version of vmapp.org
Login or Join
Fox8124981

: Need help to understand the URL for dynamic content As I understand, web servers are able to map the path component of an URL either into local file system resource or web-application name.

@Fox8124981

Posted in: #WebDevelopment

As I understand, web servers are able to map the path component of an URL either into local file system resource or web-application name. Example for former would be www.example.com/index.html. In this case, as I understand it, the web server would simply take the /home/www/index.html file and return it to requester. Example for web-applications would be www.example.com/get-page.php?home=aaa.html. Am I correct that get-page.php is the web-application name, i.e script file /home/www/get-page.php which is executed in server and aaa.html is a value for variable home used in this script?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Fox8124981

1 Comments

Sorted by latest first Latest Oldest Best

 

@Martha676

In short, yes you are correct. The only big part of the equation you are missing is server-side URL rewriting - where essentially a request for www.example.com/aaa could be internally redirected by the web server software to
www.example.com/get-page.php?home=aaa.html
as a method of having more user-friendly URL's or pretty URL's.

If your webserver software is Apache then this is achieved using .htaccess files and RewriteCond/RewriteRule.

See mod_rewrite documentation for more information about this.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme