How can I make this kind of navigation system on my page?
-
I am going to make a webpage, and the problem is with the navigation system. I know programming languages from matlab to c#, but I have some problems with php. I wish to make the navigation system SEO friendly, so my subpages on the site will look like this: site.com/about and NOT this: site.com/index.php?page=about. To do it I have to make a directory system (I guess) where for example in the directory "about" there will be the sub index.php file, which includes the main header from the root directory, then the content of the about page, then the footer.php from the root directory. If I write the code with includes(), the php parser looks for the files in the sub directory which are in the main directory. My question is that how can I set the root dir. in the php to establish a relative navigation point. Also, I guess the parser will look for the stylesheet and the javascript files in the subdir, rather than in the root of the site. Has anyone made such a page? I know it is easy, but I can't make it work,I appreciate every answer and everything that can make this happen. Also I will be glad to receive suggestions on what to look for, take care of when building a site like this. Thank you for every answer in advance. A.
-
Answer:
I am pretty sure it would be easy enough to do, as long as you only have 1 page in each sub-directory with the default page name... like index.php or index.htm. That way anytime you go to the directory it will grab the default page. site.com/about would load site.com/about/index.php site.com/feedback would load site.com/feedback/index.php site.com/contactus would load site.com/contactus/index.php etc.... Not really a good way to setup a site, but it could be done that way. In php you do not need to pass a variable like in your example of site.com/index.php?page=about You can just use any valid filename with a .php extension. Like about.php or contact.php, etc. Your choice. Best wishes and good luck on the site.
Agota at Yahoo! Answers Visit the source
Related Q & A:
- How can I make a download page?Best solution by Stack Overflow
- How can I make a dynamic web page in PHP?Best solution by Yahoo! Answers
- How can I make My Yahoo! my home page?Best solution by Yahoo! Answers
- How can I make a page my home page?Best solution by Yahoo! Answers
- How can I make Yahoo as my home page?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.