Problems with php5 on .httaccess |
[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 What I did is change this to: Code: Options +FollowSymlinks 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. But I have no idea in how can I work with mode rewrite, can you help me? thanks.
[eluser]theprodigy[/eluser]
why not just try: Code: addtype application/x-httpd-php5 .html .htm
[eluser]1234qwer[/eluser]
Nopi, that doesn´t work. I have the same error as with mine. Any idea?
[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
[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
[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 - 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
[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.
[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.
|
Welcome Guest, Not a member yet? Register Sign In |