Welcome Guest, Not a member yet? Register   Sign In
Problems with php5 on .httaccess
#1

[eluser]1234qwer[/eluser]
hello.


On my server to access php5 I need add the following lines to .htaccess file:


Code:
addtype application/x-httpd-php5 .html .htm
AddType application/x-httpd-php5 .php
AddHandler application/x-httpd-php5 .php


What I did is change this to:




Code:
Options +FollowSymlinks
RewriteEngine on

addtype application/x-httpd-php .html .htm

Rewritecond %{REQUEST_FILENAME} !-f
RewriteRule \.php$ /error404.html



RewriteBase /

RewriteCond $1 !^(\/|index\.php|system|application|iservices|mod_css|seo|Plugins-Testimonios|links|mod_img|mod_galeria|mod_scripts|includes|adm_img|adm_css|resize|views|templates|img|imgs|js|css|images|tester|system\/plugins|robots\.txt|language|css\/)

RewriteRule ^(.*)$ http://www.site.com/index.php/banano/index/$1 [L]


addtype application/x-httpd-php5 .html .htm
AddType application/x-httpd-php5 .php
AddHandler application/x-httpd-php5 .php

And now in the front side what I have is:


"No input file specified. "

That`s all!!

The server people says:

Quote:This issue caused by your rewrite rule.

Please correct it.

Additional information can be found there: http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html

But I have no idea in how can I work with mode rewrite, can you help me?

thanks.
#2

[eluser]theprodigy[/eluser]
why not just try:
Code:
addtype application/x-httpd-php5 .html .htm
AddType application/x-httpd-php5 .php
AddHandler application/x-httpd-php5 .php

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>
I've had to use something similar to this on my shared hosting account before. I just put the wiki version of the htaccess below the addtype's and addhandler's
#3

[eluser]1234qwer[/eluser]
Nopi, that doesn´t work. I have the same error as with mine.
Any idea?
#4

[eluser]Jelmer[/eluser]
Htaccess errors tend to be very uninformative. The only way to find out which line is causing the error is by removing all and than adding the lines back one by one (or in parts when they're dependent on eachother).

Or you might not be allowed by your server to use "addtype" or "addhandler" in the .htaccess.
On my server there's both PHP4 and 5, I had to change the default PHP4 tot 5 by using this line:
Code:
SetEnv DEFAULT_PHP_VERSION 5
#5

[eluser]1234qwer[/eluser]
That doesn´t work on my server. The server tech says:

You should re-check / correct these lines:

RewriteCond ///
RewriteRule ///


But that doesn´t have sense to me. It has for you?

thanks
#6

[eluser]Jelmer[/eluser]
Your htaccess rules are ordered very weird and contain some stuff I'm not sure about whether it can work. Here's a reordered list, but if that doesn't work you should try my earlier suggestion: remove lines and start adding them back one by one to see which one breaks it.

Problems:
- Two addtype rules for .htm and .html
- I've merged similar addtypes
- I don't think addhandler needs the 'application/' part
- The code below doesn't make much sense to me (it means: rewrite any request for a file that doesn't exist ending in .php)
Code:
Rewritecond %{REQUEST_FILENAME} !-f
RewriteRule \.php$ /error404.html
- I'm assuming you want to rewrite to the local index.php and not redirect, so you don't need the full URL
- The RewriteCond for the final rule doesn't need to end and start with a negated /
- You should use the routes.php config file (look it up in the user guide) to rewrite to a specific controller, use the .htaccess only to rewrite to the index.php
- I've added a ? between "index.php" and the following slash, that isn't always needed.

Code:
AddType    application/x-httpd-php5 .html .htm .php
AddHandler x-httpd-php5 .html .htm .php

Options +FollowSymlinks
RewriteEngine on
RewriteBase /

Rewritecond %{REQUEST_FILENAME} !-f
RewriteRule \.php$ /error404.html

RewriteCond $1 !^(index\.php|system|application|iservices|mod_css|seo|Plugins-Testimonios|links|mod_img|mod_galeria|mod_scripts|includes|adm_img|adm_css|resize|views|templates|img|imgs|js|css|images|tester|system/plugins|robots\.txt|language)
RewriteRule ^(.*)$ /index.php?/$1 [L]
#7

[eluser]1234qwer[/eluser]
Now what I have is the attached image.

What I need?
1. I need php5 working on site. To do that my server says I need add those lines to .htaccess.

And

2. I need canonize all the site, that means all request to:

www.site.com
site.com
site.com/index.php
www.site.com/index.php
www.site.com/index.html

must go to:
www.site.com/

Some day somebody tellme to do that in the routes archive, I open the archive, I check the documentation and I have no idea In what to do.

I really appreciate your time and if you can help me to fix that kind of problems because this is a CMS (we build in our company) and it is ussed in many site with that kind of problems, for that reason I want find a final solution.

Too many thanks.
#8

[eluser]Jelmer[/eluser]
Every server is different and I gave you some pointers in the previous topic. In the end you'll need to do the debugging yourself, try a google search for how htaccess works and see what worked for others. Htaccess is always difficult because server settings and what is and isn't allowed changes a lot.
Do some research yourself, I learned much from the CI forums but probably more from just googling stuff.

The user guide is pretty good, so if you read it I find it hard to believe you can't understand routes. Also: first make a default page work, after that (and actually reading the user guide) it's not that hard to find out by trial and error how routes work.
#9

[eluser]1234qwer[/eluser]
Ok, I will.
Thanks for your time.




Theme © iAndrew 2016 - Forum software by © MyBB