views:

73

answers:

1

How do I configure a CodeIgniter app so I can have one directory that will just serve some static (not MVC) html?

I want to handle some existing links, in the form of:

http://mysite/contactform/contact.html?queryvars

Anything in the /contactform directory including sub-directories (which is just some css, js, images,etc) should not go through the CodeIgniter pipeline. What is the best way to handle that? (I am normally a Windows dev, so speak slowly)

I figure it has to be done in the rewrite config?

routes.php is very basic:

$route['default_controller'] = "home";

rewrite rules from .htaccess:

# you probably want www.example.com to forward to example.com -- shorter URLs are sexier.
#   no-www.org/faq.php?q=class_b
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

RewriteEngine on
RewriteCond $1 !^(index\.php|contact\.php|images|css|js|video|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
A: 

Modify your .htaccess like so:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

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

RewriteCond %{REQUEST_FILENAME} !-f tells mod_rewrite ignore the url if it's an actual file, and RewriteCond %{REQUEST_FILENAME} !-d tells it to ignore it if it's a directory.

Rocket