Please Log In to save to favorites
TAGs
multiviews, folders, url


Versions
Multiviews for your website
by steven
If you do not want to have you URL look for example like www.yourwebsite.com/news.php?id=12, but more professionally such as www.yourwebsite.com/news/12 you can use multiviews. It should not be that hard to do.. at least if you know what to do.
      
    1.   /*
    2.   To start you add the following sentence to your .htaccess file in the directory you are using (if you are using a webhost and not your own Apache):
    3.   Options Indexes FollowSymLinks MultiViews All
    4.   
    5.   Now it is already working on your website, but how can you get the ID you might be asking? Do the following. Put the sentence below in your header and you can use the folders your URL as arrays.
    6.   */
    7.   
    8.   $var = explode('/' , $_SERVER['REQUEST_URI']);
    9.   
    10.   /*
    11.   So if you want to get the ID of your news from for example www.yourwebsite.com/news/12, you will get the information needed from $var['2'].
    12.   */
Comments


Nice one

Posted by: Ramon around 18 Months Ago

Been using something like this for some years now. Recently added a "breadcrumb" functions which works with the same principle.