.htaccess - clean url using php -
.htaccess - clean url using php -
this question has reply here:
reference: mod_rewrite, url rewriting , “pretty links” explained 4 answersive seen things
<?php if(is_array($_get)) { $page = isset($_get['p'])?strtolower(urlencode($_get['p'])):'index.php'; $page = preg_replace('/[^a-za-z0-9]/','',$page); // echo '['.$page.']'; } else $page = ''; if(!file_exists($page.'.php')) require("index.php"); else require(_path_.$page.'.php');
} ?>
but dont how works entirely.
basically want php , htaccess believe know, example; domain.com/page/about go domain.com/pages/about.php , output contents? know ive seen somewhere forget called! i've been searching forever now!
im not best @ code , need bit help do, please.
i think you're looking mod_rewrite
. see apache's documentation comprehensive explanation. tuts+ has nice tutorial.
you want the page token , pass script parameter, script evaluate.
if don't need total functionality of mod_rewrite
, you're looking drop php extension, question more relevant: .htaccess; no extension required
php .htaccess
Comments
Post a Comment