Copy link to clipboard
Copied
Hi
We're running ColdFusion9 with Apache 2 and want to access .cfm files without specifying any extensions. This used to work with CF5 (don't ask... ^^) and Apache1.3.x.
Here's a simple example with two aliases for accessing the administrator pages of ColdFusion:
Entries in httpd.conf:
Alias /Admin "/usr/local/httpd-2.2.16/htdocs/CFIDE/administrator/index.cfm"
Alias /Admin.cfm "/usr/local/httpd-2.2.16/htdocs/CFIDE/administrator/index.cfm"
When accessing the page with http://localhost/Admin.cfm, everything works fine.
When accessing the page with http://localhost/Admin though, we get 403 (Forbidden), and that's it.
It seems, that JRun looks at the extension of the original request (that is, before the alias mapping takes place) in order to find out whether it has to forward the request to the CF server or not. But we can't specify a nonexisting extension to the AddHandler-clause.
Is there any way make this work?
Using redirects instead of aliases works, but a redirect involves the client which is inacceptable since it would double the #requests.
Kind regards!
Daniel
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hm.. your reply seems to be empty, mack_! I hope this doesn't mean that it's not possivle.
Regards
Daniel
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Both mod_rewrite and mod_alias seem to have the same problem. They work with HTML or with PHP pages the way I'd expect. But with ColdFusion pages I get a Forbidden (403).
Regards
Daniel
Copy link to clipboard
Copied
I'm using mod_rewrite with ColdFusion and PHP on quite a number of
sites and it works perfectly so I think there's something in your
setup that generates the 403 message. Does the user ColdFusion runs as
has read access to the files ?
--
Mack
Copy link to clipboard
Copied
Hi Mack
Yes, permissions and stuff should all be ok. Since aliasing/rewriting works like a charm, when using for example "Whatever.cfm" as an alias/rewrite for the CF admin, but without .cfm it doesn't work, it doesn't seem to be a permission problem.
I can't check at the moment but I've stumbled over the PT flag for the RewriteRule. Maybe you're using this flag? The documentation reads:
This flag forces the rewrite engine to set the uri
field of the internal request_rec
structure to the value of the filename
field. This flag is just a hack to enable post-processing of the output of RewriteRule
directives, using Alias
, ScriptAlias
, Redirect
, and other directives from various URI-to-filename translators. For example, to rewrite /abc
to /def
using mod_rewrite
, and then /def
to /ghi
usingmod_alias
:
So maybe jrun.so behaves exactly like mod_alias and would still use /abc instead of /def, unless I'm specifing the PT flag. I will try that tomorrow...
Regards
Daniel
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You want to specify each .cfm file in an Alias rule ? RewriteMap works
only for mod_rewrite, you would still need to specify the files twice,
once in the rewrite map file and once in the Alias rule.
Do you really need to alias indivirual files ? (aliasing whole
directories is much easier...)
--
Mack
Copy link to clipboard
Copied
At the moment (CF5) we have about 300 aliases of the form
Alias /something /some_path/some_other_path/something_else.cfm
This doesn't seem to work anymore under CF9, sind jrun22.so can't pass the request to ColdFusion anymore, since something doesn't have a .cfm extension. This is solved by my RewriteCond/RewriteRule stuff. Now I can use my 300 aliases again - with a slight change:
Alias /something.cfm /some_path/some_other_path/something_else.cfm
Copy link to clipboard
Copied
Forgot to answer your question... yes, I have to alias every single cfm page, since the alias and the path to the real cfm page doesn't have anything to do with each other.
Copy link to clipboard
Copied
I'm sure that you can do the same thing using only mod_rewrite only,
without using mod_alias (I'm doing something similar or a number of
sites).
Your solution with RewriteMap is a good one.
--
Mack