.htaccess - Htaccess mod_rewrite: how to change page.php to /page? -


simple question:

domain.com should lead index.php

and domain.com/lala (or other word) should lead products.php?name=lala

could give me rewrite rule?

thanks

assuming have .htaccess file in web root / directory

rewriteengine on rewritebase /  rewritecond %{request_filename} !-d # not dir rewritecond %{request_filename} !-f # not file rewriterule ^(.*)$ products.php?name=$1 [r=301,l]  rewritecond %{request_uri} ^/$ rewriterule ^ index.php [r=301,l] 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -