[opencms-dev] Append trailing slash to folder URL

Achim Westermann achim.westermann at gmx.de
Thu Nov 4 23:27:29 CET 2010


Hi Paul,

you wouldn't need a case for each possible extensions as mod_rewrite 
supports regular expressions. You could match (pseudocode) 
<anything>/<justletters> for the rewrite to <anything>/<justletters>/ 
and done.

Regarding doing this within OpenCms.

Option 1) Feature request. Funding (negotiation with Alkacon) will 
highly increase the possibility of having this implemented quickly.

Option2) If you are just speaking of inner-page links (those links that 
are generated by OpenCms) ensure that your links are correct. Do this by 
just allowing editors to enter links by offering XMLContent values of 
type OpenCmsVfsLink, OpenCmsVarLink,... .


cheers,
Achim


On 11/04/2010 11:16 PM, Paul-Inge Flakstad wrote:
> Hey Achim,
>
> Thanks! Yeah, you're right about that - and we do indeed use the .html extension, so it is a plausible solution. But wouldn't you have to add rules for all filetype extensions, not just .html? Like .xml, .jpg, .png ...and the list goes on.
>
> I really like the idea of doing this in OpenCms though. (And in my opinion, this should have been the default behaviour of OpenCms, but for some reason it's not.)
>
> Would it be possible to override a request handler or something? Or, generally speaking: could I accomplish what I want in OpenCms through a module, or would I be forced to modify the OpenCms core?
>
> Cheers,
> Paul
>
> ________________________________________
> Fra: opencms-dev-bounces at opencms.org [opencms-dev-bounces at opencms.org] på vegne av Achim Westermann [achim.westermann at gmx.de]
> Sendt: 4. november 2010 22:47
> Til: The OpenCms mailing list
> Emne: Re: [opencms-dev] Append trailing slash to folder URL
>
> Hi Paul,
>
> you could drop having to do it within OpenCms if you are able to
> establish the naming convention of files to have an extension (.html).
>
> kind regards,
> Achim
>
>
> On 11/04/2010 10:29 PM, Paul-Inge Flakstad wrote:
>> Hi Yves,
>>
>> I thought of that (but not very deep), but wouldn't I have to do it in OpenCms, since I'd first need to determine if the requested resource is a folder?
>>
>> Cheers,
>> Paul
>> ________________________________________
>> Fra: opencms-dev-bounces at opencms.org [opencms-dev-bounces at opencms.org] på vegne av Yves Glodt [yg at mind.lu]
>> Sendt: 4. november 2010 22:21
>> Til: The OpenCms mailing list
>> Emne: Re: [opencms-dev] Append trailing slash to folder URL
>>
>> Maybe urlrewrite or mod_rewrite can help you?
>>
>> -
>> Sent from my Android
>>
>> On Nov 4, 2010 5:19 PM, "Paul-Inge Flakstad"<flakstad at npolar.no<mailto:flakstad at npolar.no>>   wrote:
>>> Good evening lads and ladies,
>>>
>>> I'd like to redirect requests to folder resources with no trailing slash to the same URL, but with the trailing slash.
>>>
>>> E.g. a request to
>>> http://www.mysite.com/en
>>> Should be redirected to
>>> http://www.mysite.com/en/
>>>
>>> OpenCms does not do this automagically, and the fact that the same resource is served from both URLs can cause problems in terms of SEO (duplicate content).
>>>
>>> Would appreciate any solutions, or even just a pointer. Can't imagine I'm the first to face this problem. Did I overlook something basic?
>>>
>>> All the best,
>>> Paul
>>>
>>> _______________________________________________
>>> This mail is sent to you from the opencms-dev mailing list
>>> To change your list options, or to unsubscribe from the list, please visit
>>> http://lists.opencms.org/mailman/listinfo/opencms-dev
>>
>> _______________________________________________
>> This mail is sent to you from the opencms-dev mailing list
>> To change your list options, or to unsubscribe from the list, please visit
>> http://lists.opencms.org/mailman/listinfo/opencms-dev
>>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>



More information about the opencms-dev mailing list