Relative path to sub-directory in PHP and Apache's htaccess file -
i working on own php framework. developing on localhost , related project in subfolder called ruddyphpframework, path this:
localhost/ruddyphpframework/
in folder, have index.php, init point of whole framework. working on own router, have 2 problems. first, in apache's htaccess file have this:
rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewriterule (.*) ruddyphpframework/index.php [l]
so whenever acces page this:
localhost/ruddyphpframework/something/smtelse/
the index.php init application , echo path me, is:
[path] => /ruddyphpframework/something/smtelse/
but not excatly want. want relative path subfolder (i don't know if explaining correctly), example:
[path] => /something/smtelse/
and problem want setup htacces last line this:
rewriterule (.*) index.php [l]
so go index.php in folder htaccess file (/ruddyphpframework/index.php) , not /index.php, without specifying foler, because if else using framework, might have in folder different name.
first please stop have enouth frameworks already. regarding question. project in localhost/ruddyphpframework htaccess read url first / skips localhost because it's domain , taiks uri witch starts /
so project setup incorrect. try not shure 100%:
rewriteengine on rewritebase /ruddyphpframework/ rewritecond %{request_filename} !-f rewriterule (.*) index.php [l]
please try it. , did helped.
Comments
Post a Comment