FarCry Friendly URLs

Hello!

I would like to ask you if it’s possible to configure Lucee (urlrewrite.xml) and how according to Apache’s config instructions (mentioned here), in order to run FarCry URL friendly requests without a problem.

That would help me a lot!

Regards

Hi @asimkon

Yes it is possible

Install lucee with Apache using centos, rhel, debian or other using the lucees download script installer and follow the prompts.

After installation make sure you have the directive for your virtualhost or directory set to Allow Overrides. Finally add either ther .htaccess with the code you want mod_rewrite to run or enable it directory in the server configuration file.

I have already installed Lucee via Commandbox (https://commandbox.ortusbooks.com/embedded-server/configuring-your-server/url-rewrites) on Windows OS and my query is if i could work entirely on Lucee by copying Apache config url directives to Lucee urlrewrite.xml using only tuckey syntax.

Regards

Apache Tomcat works differently than Apache HTTPD.

Short short answer, Not without modification, as the syntax is slightly different.

I would take a look at rewriting under Tomcat and convert accordingly.
https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html

@Terry_Whitney because this is commandbox, there is no Tomcat in this scenario. CommandBox runs with the servlet container engine “Undertow” and here the Tuckey filter is used for urlRewrite.

@asimkon First thing I see is that FarCry is using a regex with a character set (inside of square brackets [ ] ), and I really don’t know why they are escaping lots of characters with the backslash in their rewrite rule: regex meta characters inside of character sets are different than outside as I told you already on my comment to your post on SO. However, if the team of FarCry post it as a working solution, then it should work with Apache2. Did you also try setting the rules for tuckey with the mod_rewrite-style-rules enabled? Then this plain rule as posted by the FarCry Team should work for Tuckey.

1 Like

Thanks for your reply!

I followed the rules from Far Cry team regarding friendly url for Apache .htaccess. Unfortunately the search friendly url problem still remains, despite the fact that I got an application update message.

Chelsea Boots theme

Regards

Could you please describe the problem that still remains a little? Any error? Any stack trace? Do you have any concrete example so we can try to reproduce it?

The problem has to do with HTML 404 status (/search?q=blabla) and unfortunately it’s not traceable via (?debug=1) as it returns no feedback at all.
If you try to install FarCry CMS 7.2.8 via Commandbox (embedded Lucee Server) according to these database instructions and of course Chelsea Boots, definitely you will run into this type of error.

Everything else works ok except the above one. I could post you all my project, but i have not done anything yet only just a simple installation of FarCry CMS. I have uploaded in my previous post thread the Chelsea Boots theme due to the fact that i am a new user.

Regards

Are you saying everything works ok? So all the other friendly urls are working normally and only the search above is not returning content?

Very sad to just find out in other cross posts of yours, that you have a longer thread about your issue here:

Sad is, that it has to be me who is sharing that very informative link to your issue, while we keep asking and asking.

Thanks for your reply and interest!

I just say that regarding this particular Chelsea Boot theme all the menu links work without problem except search request, MAYBE it is a friendly url issue MAYBE NOT, i am not sure. I think it would be better if you try and install it and see yourself what is happening wrong via commandbox (lucee embedded server).

Regards

Thanks again for your interest!

I have got a longer thread about my issue in FarCry technical support page, because NOT ALWAYS BUT USUALLY there are more possibilities to resolve that issue. Additionally there is ALWAYS an issue page in github open source project.
Besides i have also asked in Stackoverflow about that issue as soon as i realized it would be difficult to find a solution in FarCry github or respective forum and unfortunately they told me that it’s the wrong place. If you could install it yourself via Commandbox (lucee embedded server - Chelsea Boots), perhaps you could realize more things as more experienced user than me.

Regards

Question: does the following search link as you posted on your issue at the farCry discourse forum still work?

/index.cfm?type=dmSimpleSearch&view=displayPageStandard&bodyview=displayTypeBody&q=giant

If so, then I’d try to create a UrlRewrite rule to catch these search requests /search?q=giant and rewrite it to the working URL /index.cfm?type=dmSimpleSearch&view=displayPageStandard&bodyview=displayTypeBody&q=giant

Yes that menu link works fine at least for me and it catches (q) search requests. If you could create a custom Rule via customRewrites.xml, i would be delighted.

Regards

can you please post how your working customRewrites.xml looks at the moment and add it here as code?

I have not created a customRewrites.xml yet. I intend to add it to my project folder similar to .htaccess (does not work).

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 4.0//EN" "http://tuckey.org/res/dtds/urlrewrite4.0.dtd">
<urlrewrite>
    <!-- this will redirect the user from /foo to /index.cfm -->
    <rule>
        <from>^/foo$</from>
        <to type="redirect">/index.cfm</to>
    </rule>
    <!-- internally redirect the requested URL from /gallery to /index.cfm?page=gallery with query string appended -->
    <rule>
        <from>^/gallery</from>
        <to type="passthrough" qsappend="true">/index.cfm?page=gallery</to>
    </rule>

</urlrewrite>

And afterwards use this commandbox (hopefully not to have got any problem)
start --rewritesEnable rewritesConfig=customRewrites.xml

At this moment i have not had access to this specific project as i work away from home due to some unexpected reasons. I will be able to reply you wth more specific remarks from tomorrow.

If it works, you could post your reply to Stackoverflow and give you definitely full credit. I had had another issue with Lucee here.

Thanks a lot for your interest!