Remove .php extension with .htaccess -


yes, i've read apache manual , searched here. reason cannot work. closest i've come having remove extension, points root directory. want work in directory contains .htaccess file.

i need 3 things .htaccess file.

  1. i need remove .php

    a. have several pages use tabs , url looks page.php#tab - possible?

    b. have 1 page uses session id appended url make sure came right place, www.domain.com/download-software.php?abcdefg.

is possible? in doing this, need remove ".php" links in header nav include file? should ie "<a href="support.php">support</a>" <a href="support">support</a>?

  1. i force "www" before every url, it's not domain.com, www.domain.com/page.
  2. i remove trailing slashes pages.

i'll keep looking, trying, etc. being in sub directory cause issues?

gumbo's answer in stack overflow question how hide .html extension apache mod_rewrite should work fine.

re 1) change .html .php

re a.) yup, that's possible, add #tab url.

re b.) that's possible using qsa (query string append), see below.

this should work in sub-directory path:

rewritecond %{request_filename}.php -f rewriterule !.*\.php$ %{request_filename}.php [qsa,l] 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -