Nice URLS PHP .htaccess


SUBMITTED BY: Guest

DATE: Jan. 15, 2014, 9:48 p.m.

FORMAT: PHP

SIZE: 585 Bytes

HITS: 735

  1. .htaccess
  2. RewriteEngine On
  3. RewriteCond %{REQUEST_FILENAME} !-f
  4. RewriteCond %{REQUEST_FILENAME} !-d
  5. RewriteRule ^(.*)$ $1.php [L,QSA]
  6. # http://domain/about -> http://domain/about.php
  7. --------------------------------------------------
  8. .htaccess
  9. RewriteEngine On
  10. RewriteCond %{REQUEST_FILENAME} !-f
  11. RewriteCond %{REQUEST_FILENAME} !-d
  12. RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
  13. # http://domain/about -> http://domain/index.php?q=about
  14. <?php
  15. // $url_data is an array
  16. $url_data = explode("/",$HTTP_SERVER_VARS['PATH_INFO']);
  17. ?>

comments powered by Disqus