cabofixe Posted February 26, 2009 Share Posted February 26, 2009 Hey all, So I feel like what I want to do isn't too hard. I'm making a simple cms program and I want EVERY URI to be parsed through the controller. My .htaccess file looks like this: Options +FollowSymlinks RewriteEngine on RewriteRule . control.php [L] It works well for almost everything. You can try it at: http://lawfirmsites.com/clondon/ or http://lawfirmsites.com/clondon/index or http://lawfirmsites.com/clondon/test. If you type something that doesn't exist it defaults to index. Later I'll make it go to an error controller. It all works perfectly except for one url: http://lawfirmsites.com/clondon (Note the lack of a trailing slash). It gives me a 400 Bad Request error. Anybody know how I can correct this? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
cabofixe Posted February 26, 2009 Author Share Posted February 26, 2009 Oh I forgot to mention. ALL files are located in the directory clondon/. The entire script is located http://www.lawfirmsites.com/clondon/ Quote Link to comment Share on other sites More sharing options...
corbin Posted February 27, 2009 Share Posted February 27, 2009 Try changing the rewrite rule to: RewriteRule .* control.php [L] (By the way, if someone ever went to control.php, it would create an infinite loop since control.php would be redirected to control.php which would be redirected to control.php so on....) What directory is your htaccess file in? If it's in /clondon/ that might be what's causing the problem. I'm not sure why, but Apache might not parse the file right in /clondon/ if you go to /clondon. (Technically /clondon could be a file since there is no trailing slash, but Apache should automatically add the trailing slash if the file doesn't exist.) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.