0
votes

I got a problem with routing in my application. My folder structure looks like:

  • application
  • css
  • images
  • js
  • svc // Slim Application Folder
  • index.php
  • .htaccess

If I call a slim route http://www.mydomain.de/svc/hello/world I get an 404 Error from codeigniter. My htaccess in the root looks like this:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]

What can I do?

1

1 Answers

0
votes

I think you just need to add an other RewriteRule before the current one to handle ^svc requests and if that won't match fall back to the codeigniter's front controller (the slim rewrite lifted from its source)

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^svc svc/index.php [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L]