Welcome Guest, Not a member yet? Register   Sign In
access folder not controller?
#1

[eluser]w1n78[/eluser]
i got my mod_rewrite working properly but i would like to create a "files" folder and have some pdf files inside it so it would look like domain.com/files/file1.pdf. but in CI this means it's trying to access a controller named "files" which doesn't exist. how do i create a folder called "files" and not have CI think it's a controller but just a regular folder?
#2

[eluser]LiquidFusi0n[/eluser]
Put it in your document root. So make a folder outside of system, application etc... etc...

Then you shouldn't have any issues accessing the directory.

Source: I just did it Big Grin

Regards,
LiquidFusi0n
#3

[eluser]Matalina[/eluser]
if you are using .htaccess to remove index.php then you need to be careful with it. It assumes all "directories" are controllers unless you tell it otherwise.
#4

[eluser]CroNiX[/eluser]
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Try this .htaccess, which says if the request isn't a real (f)ile and it isn't a real (d)irectory, process the request with CI (index.php), otherwise process request as normal file/directory.

If this doesn't work, use your current line similar to the last RewriteRule that does work, but replace the other lines.
#5

[eluser]w1n78[/eluser]
[quote author="LiquidFusi0n" date="1330620063"]Put it in your document root. So make a folder outside of system, application etc... etc...

Then you shouldn't have any issues accessing the directory.

Source: I just did it Big Grin

Regards,
LiquidFusi0n[/quote]

thanks, this worked. i had the wrong url. i was loading my production site not my development site. /facepalm




Theme © iAndrew 2016 - Forum software by © MyBB