Welcome Guest, Not a member yet? Register   Sign In
drop index.php when CI is a sub-dir?
#11

[eluser]LiorBroshi[/eluser]
THANK YOU rogierb! works ;-)

Lior.
#12

[eluser]LiorBroshi[/eluser]
Hmmm


what should I do know if i'm trying to access mydomain.com/1.mp3? codeigniter tries to take it... ;/


Lior
#13

[eluser]Cro_Crx[/eluser]
Rather than setting the rewrite conditions to point to the directory that CodeIgniter is in, you can use the RewriteBase path instead. This should fix not being able to access other parts of your site. Here's an example:

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /CodeIgniter/installation/path

    #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>
#14

[eluser]LiorBroshi[/eluser]
Hmm

Still, When i try to access mysite.com/1.mp3 it gives me '404 Page Not Found' since codeigniter is searching for a matching controller (which does not exists).


Lior
#15

[eluser]Cro_Crx[/eluser]
The above two rules in the .htacess:

Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

Are used so that if the file actually exists it will be opened (Instead of loading the appropriate controller). That means if you have a file called 1.mp3 it should load fine. If there is no file then you'll get a 404 like you are currently.
#16

[eluser]LiorBroshi[/eluser]
Thanks!! ;-)




Theme © iAndrew 2016 - Forum software by © MyBB