Tuesday, 15 July 2014

php - how to read source by RewriteRule -



php - how to read source by RewriteRule -

this question has reply here:

how show php-files plain text in apache 5 answers

i want help in problem

this command not work can u help me

i have new folder on website under name

"textphp"

and set code in .htaccess

rewriterule ^(.*) /home/myhome/public_html/$1.php [l,t=text/plain]

i want 1 go folder can read source php files

and not work

i seek h=text/plain

and got error 500

also seek php_value engine off php_value engine off

not working :(

its there other trick

and sorry english language language bad :p

thanks helping

you don't specify total path file in rewrite rule, specifiying new absolute url or uri relative web root. if want create uri go php file of teh same name, here how it:

rewriteengine on rewriterule ^(.*) /$1.php [l]

no need specify /home/myhome/public_html here.

this basic illustration however, typically, much broad of rule, prevent serving images or other actual files web root (they end .php appended the. assuming want, commonly see like:

rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*) /$1.php [l]

this rule applies in cases when uri not match actual filename or directory. requests /some_file.php not redirected /some_file.php.php.

php apache .htaccess mod-rewrite

No comments:

Post a Comment