Is it okay to always link to the full URL?
Posted: Thu Dec 09, 2010 4:30 am
Hello, I am creating a site that has a navigation bar at the top that never changes. I get the navigation bar into the html code by using <?php $file = file_get_contents ("navigation_code.php"); Echo $file;?>. I recently created some folders to organize my files, and that caused all the links to be broken. So to fix this, i just used the full url for every link in my whole site. Rather than href = "home.php" it now says href = "http://mysite.com/home.php." This fixes the problem.
My first question is, is there anything wrong with doing it this way (href = "home.php" changed to href = "http://mysite.com/home.php.")? I read something about how this affects the caching process, I didn't uderstand it.
My second question is, is this way (php - get_file_contents()) of creating sitewide content good practice? It works great, and editing my site's navigation/header/footer is quick; I change one file and the whole site is adjusted perfectly. Does this make the page load faster or slower? Is there anything else that I should know?
Thanks for all the help.
My first question is, is there anything wrong with doing it this way (href = "home.php" changed to href = "http://mysite.com/home.php.")? I read something about how this affects the caching process, I didn't uderstand it.
My second question is, is this way (php - get_file_contents()) of creating sitewide content good practice? It works great, and editing my site's navigation/header/footer is quick; I change one file and the whole site is adjusted perfectly. Does this make the page load faster or slower? Is there anything else that I should know?
Thanks for all the help.