.htaccess - Mod_rewrite question -


it possible rewrite url using mod_rewrite , htaccess user enter:

http://www.mainsite.com/12345

which server translate as:

http://www.mainsite.com/index.php?id=12345

by trying remove file extension pages, (remove .php) conflicts , causes never ending redirect:

<ifmodule mod_rewrite.c> options +followsymlinks rewriteengine on rewritebase / rewriterule ^(.*)\.php$ $1 [nc] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([0-9a-za-z]+)$ index.html?id=$1 [qsa,nc,l,r] </ifmodule> 

rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([0-9]+)$ index.php?id=$1 

Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -