php - Is it possible to do Double mod_rewrite? -
so build simple mvc app because want learn new stuff. everething thing work need change url
in .httacces
<ifmodule mod_rewrite.c> rewriteengine on rewritebase /mymvc/ rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php?%{query_string} [ne,l] rewriterule .* - [e=http_authorization:%{http:authorization},l] </ifmodule>
and url http://mysite/mymvc/about
were controller,but if move in root be
but don't want .. want
now problem use explode('/',$path)
$path = $_server['request_uri'];
because folder use second array , if change http://mysite/page:about there no / ..
i have seen people use prefix of file name let : page_about.php
so url http://mysite/mymvc/page/about
but still ugly .. tips
instead of using explode try:
preg_split("/:|\//", $path);
this explode either :
or /
.
Comments
Post a Comment