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

Personally, I do not know What to do !

followed all the tutorials, tips 've seen here in own forum and nothing worked ! = /

I use Apache 2.4 on Windows 10 with php5

I followed the steps in the following topic : http://forum.codeigniter.com/thread-6451...move+index

and yet not solved = /
Reply
#2

These are the steps that I followed:
1) Remove index.php from config.php
2) Create a .htaccess with these lines of code:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# Removes index.php from ExpressionEngine URLs
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

# Directs all EE web requests through the site index file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

And it works.
Reply
#3

I use a modified .htaccess from Fuel.php that works fine for me on Windows 10 and PHP 5+

Code:
<IfModule mod_rewrite.c>

    #Set the CodeIgniter Environment.
    #SetEnv CI_ENV development

       # Make sure directory listing is disabled
    Options +FollowSymLinks -Indexes
    RewriteEngine on

    # NOTICE: If you get a 404 play with combinations of the following commented out lines
    #AllowOverride All
    #RewriteBase /wherever/ci/is
    RewriteBase /

    # Restrict your site to only one domain
    # Important USE ONLY ONE OF THESE OPTIONS BELOW!

    # Option 1: To rewrite "www.domain.com -> domain.com" uncomment the following lines.
    #RewriteCond %{HTTPS} !=on
    #RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    #RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

    # Option 2: To rewrite "domain.com -> www.domain.com" uncomment the following lines.
    #RewriteCond %{HTTPS} !=on
    #RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
    #RewriteCond %{HTTP_HOST} (.+)$ [NC]
    #RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]

    # Option 3: Remove index.php from URL
    #RewriteCond %{HTTP:X-Requested-With}    !^XMLHttpRequest$
    #RewriteCond %{THE_REQUEST}            ^[^/]*/index\.php [NC]
    #RewriteRule ^index\.php(.*)$            $1 [R=301,NS,L]

    # Send request via index.php (again, not if its a real file or folder)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    #RewriteCond $1 !^(index\.php|public_html|\.txt|robots\.txt|favicon\.ico|style\.css)

    # deal with php5-cgi first
    <IfModule mod_fcgid.c>
        RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
    </IfModule>

    <IfModule !mod_fcgid.c>

        # for normal Apache installations
        <IfModule mod_php5.c>
            RewriteRule ^(.*)$ index.php/$1 [QSA,L]
        </IfModule>

        # for Apache FCGI installations
        <IfModule !mod_php5.c>
            RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
        </IfModule>

    </IfModule>

</IfModule>
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

(05-04-2016, 03:15 PM)reynatojunior Wrote: Personally, I do not know What to do !

followed all the tutorials, tips 've seen here in own forum and nothing worked ! = /

I use Apache 2.4 on Windows 10 with php5

I followed the steps in the following topic : http://forum.codeigniter.com/thread-6451...move+index

and yet not solved = /

Thanks dear for solving my problem, I am new to codeignitor and followed all the tutorials on net to remove index.php from url but nothing worked. After reading your problem I realised i am not the only one with same issue.  Tongue

Then I suddenly realised that I was editing the wrong .htaccess file in rootfolder/application/.htaccess
because there is no .htaccess file in rootfolder/.htaccess by default.

You have to create new .htaccess for rootfolder or copy existing file from application folder then edit it..


That all, hope this might work for you...  Wink
Reply
#5

I would honestly like to just know why this is even a thing. In all seriousness... who, how, what, when, and where would anyone use this type of url formatting convention, and why should it need to be such an issue to get rid of something that literally no one uses? Trying to find answers to this is worse than trying to find a needle in a haystack, as google is flooded with different flavors for a solution.  Dodgy
Reply
#6

(06-07-2016, 07:01 PM)slightly_peeved Wrote: I would honestly like to just know why this is even a thing. In all seriousness... who, how, what, when, and where would anyone use this type of url formatting convention, and why should it need to be such an issue to get rid of something that literally no one uses? Trying to find answers to this is worse than trying to find a needle in a haystack, as google is flooded with different flavors for a solution.  Dodgy

The "problem" is that the techniques to remove index.php are different in Apache and NGINX.
In the case of CodeIgniter, the problem can be compounded if a developer uses base_url() without configuring their app properly.
Reply
#7

on windows it will not remove index.php the firest time but if you manually remove it it will still work.

Otherwise use the .htaccess redirect 301
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB