Apache / PHP - Rewrite rule within a sub-folder redirects to root folder -


i want remove extension of php files url.

i using cpanel control virtual hosts on server.

my php files want them accessed without extension located in "folder2". folder1 subdomain.

/public_html/folder1/folder2/file1.php 

so created .htaccess file within folder2:

rewriteengine on rewritecond %{request_filename} !-f rewriterule ^([^/]+)/$ $1.php rewriterule ^([^/]+)/([^/]+)/$ /$1/$2.php rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !(\.[a-za-z0-9]{1,5}|/)$ rewriterule (.*)$ /$1/ [r=301,l] 

but when try access link: http://folder1.domain.com/folder2/file1

i redirected http://folder1.domain.com/file1 (which 404).

what's wrong .htaccess? there should enable on apache?


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -