Welcome Guest, Not a member yet? Register   Sign In
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 CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

Are you trying to use URL rewrite (www.domain.com/index.php?admin --> 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 (www.domain.com/admin) instead, which now doesn't have .php file extension.
Reply
#4

(06-19-2018, 01:04 PM)Pertti Wrote: Are you trying to use URL rewrite (www.domain.com/index.php?admin --> 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 (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, 10: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




Theme © iAndrew 2016 - Forum software by © MyBB