.htaccess file did not apply (removing .php extension) -
i tried remove .php extension using .htaccess file on xampp localhost server. set next lines it:
rewriteengine on rewriteoptions inherit options +followsymlinks options -multiviews ## hide .php extension ## externally redirect /dir/foo.php /dir/foo rewriteengine on rewritecond %{request_filename} !-f rewriterule ^([^\.]+)$ $1.php [nc,l] i have tried more options accomplish goal, nil changed. did wrong?
check if have allowoverride all in httpd.conf file (the configuration file apache). if using xampp on windows, httpd.conf file should reside in directory : c:\xampp\apache\conf\httpd.conf
add allowoverride all line in directory tag. example: <directory c:\xampp\htdocs> allowoverride allow </directory>
p.s. allowing override tell server allow .htaccess file override default configuration of server.
edit: sorry mentioned allowoverride 'on'. should allowoverride 'all'. works fine in ubuntu. i'll seek find out how create work in windows(xampp) soon.
php .htaccess
No comments:
Post a Comment