0

I am using a MVC and on my application file, I am routing this way :

# Routing
$routing = array(
    '([a-zA-Z]+)\/?'    =>  array('Post', 'view')
);
framework::routing($routing);

It means that all the URLs like "mysite.com/anything/" will be routed to the same template but with different content. Until then, everything is okay.

My problem is that I would like to make an exception for that,

because I want to access my page "mysite.com/uploads" directly into the browser, but I am redirected, due to the routing php stuff.

Is there a way to make an exception to this routing? Like route all names excepted "upload" ?

I can submit the routing file, but since it's almost the same than codeigniter maybe you won't need it really.

Thanks

René Höhle
  • 26,716
  • 22
  • 73
  • 82
pimarc
  • 3,621
  • 9
  • 42
  • 70

1 Answers1

1

Seeing that your urls don't contain the index.php part anymore, I guess that you added an .htaccess file to do that, probably one that looks like this (straight from the codeigniter docs):

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

If this is that case and the uploads folder is in the same folder as the root index.php file of codeigniter, you should change the second line to:

RewriteCond $1 !^(index\.php|images|uploads|robots\.txt)

But this all depends on your specific configuration.

EDIT: Altough it seems that you aren't using CodeIgniter, the same applies to Zend Framework MVC. You should make an exception to the rewrite rules to allow direct access to your upload directory.

zeebonk
  • 4,864
  • 4
  • 21
  • 31