CodeIgniter Forums
Routing problem to an external application - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Routing problem to an external application (/showthread.php?tid=3668)



Routing problem to an external application - El Forum - 10-16-2007

[eluser]Référencement Google[/eluser]
Hi,

I've got problems with an external Webstats tool (awstats) wich have a directory at the root of the webfolder.

I use this small script to handle the static pages of the website, and this is what's look to make my problem:
http://ellislab.com/forums/viewthread/52505/#256605

So, typing this:
www.mysite.com/awstats ===> CI error 404
www.mysite.com/validcontroller ===> OK
www.mysite.com/staticpage ===> OK

Any help would be appreciated to reach my stats folder because I am getting crazy for about a day with this problem.


Routing problem to an external application - El Forum - 10-16-2007

[eluser]dotweb[/eluser]
use a .htaccess file in your root folder
Code:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^(/index\.php|/img|/js|/css|/awstats|/robots\.txt|/favicon\.ico)
RewriteRule ^(.*)$ /index.php/$1 [L]

so that the /awstats is not routed as a query for index.php


Routing problem to an external application - El Forum - 10-16-2007

[eluser]Référencement Google[/eluser]
Already tryed it and this is the problem!
here is my htaccess actually:

Code:
<IfModule mod_rewrite.c>

    RewriteEngine On

    # If the file or directory exists, show it
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^(.+) - [PT,L]
    
    # Blank queries get sent to the index
    RewriteRule ^$ index.php [L]
    
    # All other queries get sent to the index as index.php/whatever
    RewriteRule ^(.*)$ index.php/$1 [L]
    
    RewriteCond $1 !^(index\.php|images|robots\.txt|js|css|user_guide|/awstats)    
    RewriteRule ^(.*)$ /index.php/$1 [L]

</IfModule>