• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PHP files downloading instead of running?

#1
.htaccess file contents

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f  
RewriteCond %{REQUEST_FILENAME} !-d  
RewriteRule ^(.*)$ index.php?/$1 [L]
# Use PHP 5.4
AddHandler application/x-httpd-php54 .php
Options -Indexes

When i am deleting the .htaccess file php project opens it home page. but not working any other page like admin, users etc. But when I am putting the .htaccess file to the folder a file is downloading autometically instead of running.

Please help me.

Sk Sabbir Ali


Attached Files Thumbnail(s)
   
Reply

#2
Server Requirements
PHP version 5.6 or newer is recommended.
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#3
Are you trying to use URL rewrite (http://www.domain.com/index.php?admin --> http://www.domain.com/admin)?

In .htaccess file you are telling .php files to be run through PHP parser - I wonder if it doesn't recognise that you are redirecting everything to index.php, and uses URL (http://www.domain.com/admin) instead, which now doesn't have .php file extension.
Reply

#4
(06-19-2018, 02:04 PM)Pertti Wrote: Are you trying to use URL rewrite (http://www.domain.com/index.php?admin --> http://www.domain.com/admin)?

In .htaccess file you are telling .php files to be run through PHP parser - I wonder if it doesn't recognise that you are redirecting everything to index.php, and uses URL (http://www.domain.com/admin) instead, which now doesn't have .php file extension.

I am trying with tp://www.domain.com/admin. please help me out.
Reply

#5
(06-19-2018, 11:51 PM)sksabbirali Wrote: I am trying with tp://www.domain.com/admin. please help me out.

Then it looks like server configuration issue to me.

Typically you don't have to associate PHP file extensions via .htaccess file, so your best bet is to contact your hosting supplier and talk with them, it really depends on specific supplier setup.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.