All request now going through single file
2 posts
• Page 1 of 1
All request now going through single file
We have moved a web site into a framework that requires all pages to be requested through a single file, 'index.cfm'. I'd like to do two things:
Can I do these two things at the same time? There will be requests with subfolders that end in 'index.cfm', but these are still illegal now.
- All requests for anything other than '/index.cfm' should be redirected to http://www.host.com/index.cfm
- Eventually, specific subfolders will be redirected to specific parameters: http://www.host.com/foo/index.cfm to http://www.host.com/index.cfm?FA=bar.home
If a request doesn't match, then the first condition should be followed.
Can I do these two things at the same time? There will be requests with subfolders that end in 'index.cfm', but these are still illegal now.
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: All request now going through single file
Hello,
We can easily make this work for you:
1) To redirect everything (except index.cfm) to index.cfm
2) You would want to put these rules BEFORE index.cfm redirect:
I assume these won't be redirects per se, rather rewrites.
Regards
Andrew
We can easily make this work for you:
1) To redirect everything (except index.cfm) to index.cfm
- Code: Select all
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/index\.cfm$ [NC]
RewriteRule .* /index.cfm [NC,R=301,L]
2) You would want to put these rules BEFORE index.cfm redirect:
- Code: Select all
RewriteRule ^foo/index\.cfm$ /index.cfm?FA=bar.home [NC,L]
I assume these won't be redirects per se, rather rewrites.
Regards
Andrew
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 12 guests