Welcome Guest, Not a member yet? Register   Sign In
My index.php retardation
#1

[eluser]fourmi[/eluser]
Hey, I've trawled through the forum trying to find options answers etc. I've got that headache that gets mentioned occasionally.

What i would like is for the following link to work
http://www.anthonyclifford.com/blog.html

I've tried a couple of tests on the following URLs
1. http://www.anthonyclifford.com/index.php/blog
2. http://www.anthonyclifford.com/index.php/blog.html
3. http://www.anthonyclifford.com/blog
4. http://www.anthonyclifford.com/blog.html

Based on the following constants
* Fresh install of 1.5.4 in the root of http://www.anthonyclifford.com
* $config['base_url'] = "http://www.anthonyclifford.com/";
* controller blog.php detailed as
Code:
class Blog extends Controller {

    function index()
    {
        echo 'Hello World!';
    }
}

and the following variables
* CASE [A]: $config['index_page'] = "index.php"
* CASE [B]: $config['index_page'] = ""
* CASE [C]: $config['url_suffix'] = ""
* CASE [D]: $config['url_suffix'] = ".html"
* CASE [E]: htaccess: blank
* CASE [F]: htaccess:
Code:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
* CASE [G]: htaccess:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

FYI htaccess as
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.anthonyclifford.com$ [NC]
RewriteRule ^(.*)$ http://www.anthonyclifford.com/$1 [L,R=301]
works (just to validate vars in htaccess)

Combining the variations into different combos give up the following debugs results

Code:
Request 1    2         3                              4
Config
ACE    ok    CI:404    Apache:404                     Apache:404
ACF    ok    CI:404    "No input file specified."    "No input file specified."
ACG    ok    CI:404    "No input file specified."    "No input file specified."
ADE    ok    ok        Apache:404                     Apache:404
ADF    ok    ok        "No input file specified."    "No input file specified."
ADG    ok    ok        "No input file specified."    "No input file specified."
BCE    ok    CI:404    Apache:404                     Apache:404
BCF    ok    CI:404    "No input file specified."    "No input file specified."
BCG    ok    CI:404    "No input file specified."    "No input file specified."
BDE    ok    ok        Apache:404                     Apache:404
BDF    ok    ok        "No input file specified."    "No input file specified."
BDG    ok    ok        "No input file specified."    "No input file specified."

Has anyone got any ideas? Sorry to re-ask the age old stuff, but i'm stuck!

cheers
ant
#2

[eluser]llbbl[/eluser]
Code:
$config[’index_page’] = “”
$config[’url_suffix’] = “.html”


RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
#3

[eluser]fourmi[/eluser]
[quote author="llbbl" date="1191880958"]
Code:
$config[’index_page’] = “”
$config[’url_suffix’] = “.html”


RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
[/quote]

Thanks llbbl, but that's config BDG isn't it? (unless i'm missing an edit you have made), which works for

1. http://www.anthonyclifford.com/index.php/blog
2. http://www.anthonyclifford.com/index.php/blog.html

but responds with "No input file specified." for

3. http://www.anthonyclifford.com/blog
4. http://www.anthonyclifford.com/blog.html

As detailed above... Have i missed your point?

Thanks!
#4

[eluser]llbbl[/eluser]
correct yea I can get index.php/blog.html to work but not /blog.html...

sorry I don't know else is needed configuration wise in codeigniter. what i would suggest at this point is to add the html via the htaccess file.
#5

[eluser]fourmi[/eluser]
Still leaves me with that dang index.php though! Garggghhhhh!
#6

[eluser]llbbl[/eluser]
I have no idea how to do it in .htaccess.

I think it is possible. I am not that good at that mod_rewrite stuff to come up with a solution for you.

A solution might also be possible in the code .. but that would take hours and hours to try and find something for you.

I already spent a couple hours trying to figure something out .. Can't waste anymore time. sorry
#7

[eluser]jkevinburton[/eluser]
You are also missing the constructor:
Code:
function Blog() {
     parent::Controller();
}
#8

[eluser]fourmi[/eluser]
[quote author="[CoDeR]" date="1191902048"]You are also missing the constructor:
Code:
function Blog() {
     parent::Controller();
}
[/quote]

didn't think it was necessary for debugging Smile
#9

[eluser]fourmi[/eluser]
Ok have a solution, not sure why it works but i shan't complain!

Background: php 5, apache 1.3

Code:
$config['index_page'] = "";
$config['uri_protocol']    = "AUTO";
$config['url_suffix'] = ".html";

htacccss
Code:
RewriteEngine On
RewriteCond $1 !^(notthis)
RewriteRule ^(.+).html$ index.php?$1 [L]

notthis.html will not be handled through CI, otherwise all, and only *.html requests will be

Thanks to the forum for various nidges!




Theme © iAndrew 2016 - Forum software by © MyBB