I recently installed Lucee on Windows using the installer “lucee-5.4.5.23-windows-x64-installer” and am testing a website that previously ran using Coldfusion.
Everything works well, except that the htaccess file isn’t being read, which handles the Search Engine Safe (SES) Urls. Previously the URL mywebsite.com/profiles would translate to mywebsite.com/index.cfm?do=profiles using the htaccess rule:
HTTP Status 404 – Not Found
Type Status Report
Message The requested resource [/mywebsite/profiles] is not available
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Apache Tomcat/9.0.86
However, if I run the page http://127.0.0.1:8888/mywebsite/index.cfm?do=profiles it does work as expected.
This leads me to believe that the htaccess file isn’t being read/seen. I have tested this by adding some garbage to the htaccess file to see if it would cause the website to error, but it does not. So this file appears to be being ignored/bypassed.
Is there anything else I have to do since installing Lucee to get this to work properly? At my Lucee webhost (Vivio), the htaccess file is detected and works perfectly. So it’s just my local machine with this new installation of Lucee that seems to missing something. I checked the docs at: Configuring SES URL's on Windows OS's :: Lucee Documentation but this only seems to apply to older versions of Lucee.
So I’m not sure where to go from here. Any help would be appreciated.
Thanks.
I’m following the installation instructions. As soon as I add the FILTER code to the web.xml file, the website and Lucee admin break with the message below. I would expect that my website and the Lucee admin websites should still run as normal after adding the Filter. If I remove the code from the web.xml file, it runs as per normal again. So something about this is breaking the normal processing of the websites. Any ideas? Thanks
" HTTP Status 404 – Not Found
Type Status Report Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
The reason for this error is because the path it’s trying to access is this:
C:\lucee\tomcat\webapps\ROOT\hugirls\lucee\admin\web.cfm
but should be this:
C:\lucee\tomcat\webapps\hugirls\lucee\admin\web.cfm
I’m not sure how it’s getting that extra “ROOT” part.
The same happens if I try and access the website:
Page /hugirls/index.cfm [C:\lucee\tomcat\webapps\ROOT\hugirls\index.cfm] not found
Maybe the urlrewrite file is causing this, but I would expect it not to break the website or Lucee admin.
This is the contents of the urlrewrite file based on the docs that I got it from:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 5.0//EN"
"http://www.tuckey.org/res/dtds/urlrewrite5.0.dtd">
<!--
Configuration file for UrlRewriteFilter
http://www.tuckey.org/urlrewrite/
-->
<urlrewrite>
<rule>
<note>
The rule means that requests to /test/status/ will be redirected to /rewrite-status
the url will be rewritten.
</note>
<from>/test/status/</from>
<to type="redirect">%{context-path}/rewrite-status</to>
</rule>
<outbound-rule>
<note>
The outbound-rule specifies that when response.encodeURL is called (if you are using JSTL c:url)
the url /rewrite-status will be rewritten to /test/status/.
The above rule and this outbound-rule means that end users should never see the
url /rewrite-status only /test/status/ both in thier location bar and in hyperlinks
in your pages.
</note>
<from>/rewrite-status</from>
<to>/test/status/</to>
</outbound-rule>
</urlrewrite>
I strongly suspect that you need to add a Tomcat context directive with the value path=“hugirls” to your setup. Where to add it, depends on your setup. That would be through server.xml (old style) or adding a tomcat context file to /pathToLucee/tomcat/config/catalina/domain-name-,of-your-site/hugirls.xml.
Could you please elaborate on this. I have zero experience with Tomcat and was simply looking for a “simple” way to get SES Friendly urls to work, which is turning out not to be the case with this plugin.