I am working on one project in that project I want to have many pages so I need to copy paste the my web page structure like navigation and footer. So can anyone please tell how can i make many pages effectively. And another question also I have seen many websites address just have like this www.websitename.com/index/course There is no. html or. php extensions at the end of address then how it works.
Asked
Active
Viewed 45 times
-4
-
Your ask is unclear, you can't just blurt out questions like that. – alphα May 13 '22 at 17:32
-
sorry, I am just an beginner – Abu May 13 '22 at 17:36
-
To avoid copy-pasting parts of the page, you use a *templating system*. There are myriads of different systems available. – deceze May 13 '22 at 17:36
-
This also depends on the web server. While Apache uses rewrite as stated in the link above, IIS is different. With IIS you can specify that any request to a particular directory is handled by a specific program (EXE or DLL). Any extra path is then forwarded to the program as the relative path to handle. So it really depends on what your web server is, before it even makes sense to answer your question. – Christof Wollenhaupt May 13 '22 at 17:37
-
I want to know how nowadays websites are making many pages – Abu May 13 '22 at 17:37
-
1*"how can i make many pages effectively"* - That depends on how you want to make them. There's nothing stopping you from just creating many static pages. You might make use of some templating system, client-side or server-side. You might make a web application using any server-side technology of your choice. (You've chosen one in the question, which is a reasonable place for you to start.) You might make a single-page application (SPA) where "pages" are rendered entirely client-side. There are many options. Pick a technology you're interested in and start with some introductory tutorials. – David May 13 '22 at 17:38
-
Check this, i think this is what you meant: https://httpd.apache.org/docs/2.4/urlmapping.html Basically, you can request `example.com/home` and get the index automatically without having to specify the file `/home/index.php` you want. – alphα May 13 '22 at 17:45
-
I’d recommend you pick any halfway popular PHP framework and spend a few days going through its tutorial to at least get a feel for the possibilities… – deceze May 13 '22 at 17:50