My web is dir structured is as follows :
moving/
includes/
controllers/
includes/
etc...
I have the following questions about /moving
and all of its sub-diretories:
- How can i request any php script without the .php extension?
- How can i request
...dir/index.php?q=about
as just...dir/about
? - Where woul i place my .htaccess file?
I understand that my first question might be a duplicate, but in order to contextualize my second and third question i had to ask it.
Using WampServer 2.0 Thanks in advance.
Provided you have mod_rewrite routing non-php extension request to the proper request, you would put it in your root web directory.
If all your website files are ending with .php and you want to take off the .php extension, then you should create and .htaccess file, or if you already have it, add this rule:
RewriteRule ^(([^/]+/)*[^.]+)$ /$1.php [L]
Supposing your website pages are let's say site/about.php, site/contact.php, site/news.php, the rule above will just transform those to site/about, site/contact, site/news
Hope it helps!
apache will not parse your php script if they don't have the ".php" extention.
but, you can use mod_rewrite: