Mailing List Archive

Re: Cherokee Digest, Vol 48, Issue 5
Hi Bertrand,

For OpenCart the following rules did the trick for me (from top to bottom):

((NOT File sitemap.xml exists) AND Regular Expression /sitemap.xml) -> Redirection
The redirection handler itself contains this:
Type: Internal
Regular Expression: sitemap.xml
Substitution: /index.php?route=feed/google_sitemap

((NOT File exists) AND (NOT Regular Expression /admin)) -> Redirection
The redirection handler itself contains these two expressions:
Type: Internal
Regular Expression: ^([^?]*)(?:\?)(.*)
Substitution: /index.php?_route_=$1&$2
Type: Internal
Regular Expression: ^([^?]*)
Substitution: /index.php?_route_=$1

It took me quite some effort to figure this out as well, I hope it helps.

I think it's quite a pity that despite the magnificient web interface (I used to work with Zeus Webserver, a commercial product which was the only server I knew of that had this kind of web administration), the regular expressions are a pain.
Since a lot of questions deal with standard redirection issues (e.g. http -> https) it could make a difference if some predefined expressions would already be available in the web interface as options.

Cheers,

Peter.


_____

From: cherokee-request@lists.octality.com
To: cherokee@lists.octality.com
Sent: Tue, 12 Jun 2012 16:27:58 +0200
Subject: Cherokee Digest, Vol 48, Issue 5

Send Cherokee mailing list submissions to
cherokee@lists.octality.com

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.octality.com/listinfo/cherokee
or, via email, send a message with subject or body 'help' to
cherokee-request@lists.octality.com

You can reach the person managing the list at
cherokee-owner@lists.octality.com

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cherokee digest..."


Today's Topics:

1. Cherokee 1.0.8 redirections and regex (Bertrand FRUCHET)
2. Translate HTAccess regexp in cherokee (Bertrand FRUCHET)
3. Re: Translate HTAccess regexp in cherokee (Stefan de Konink)
4. Re: Translate HTAccess regexp in cherokee (kevin danezis)
5. Re: Translate HTAccess regexp in cherokee (PChott)
6. Re: Translate HTAccess regexp in cherokee (Locke Bircher)


----------------------------------------------------------------------

Message: 1
Date: Tue, 12 Jun 2012 16:05:52 +0200
From: Bertrand FRUCHET <astebert@gmail.com>
To: cherokee@lists.octality.com
Subject: [Cherokee] Cherokee 1.0.8 redirections and regex
Message-ID: <4FD74CC0.3020504@gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi,

I spent lot of time to make redirections available but it doesn't work.

I've to vservers :
- example.com with it's own SSL certificate
- example.fr with it's own SSL certificate

I what to redirect :
- http://example.com and http://www.example.com to https://www.example.com
- http://example.com/preprod and http://www.example.com/preprod to
https://www.example.com/preprod
AND
- http://example.fr and http://www.example.fr to https://www.example.com
- http://example.fr/preprod and http://www.example.fr/preprod to
https://www.example.com/preprod

I used the example on Cherokee website at
http://www.cherokee-project.com/doc/cookbook_http_to_https.html

vserver example.com
- behavior rule : Force HTTPS (position on top of vserver behaviors),
Final rule
- Rule type : Not SSL / TLS
- Handler : Redirection
- Rule type : External
- regular expression : /(.*)$
- substitution : https://${host}/$1

vserver example.fr
- idem rule

With this two rules, i redirect *example.com* to https://*example.com*
and *example.fr* to https://*example.fr*
But i don't know how to redirect *example.fr* to https://*example.com*

Can someone help me ?

Thanks in advance,
Bertrand (French System Admin)




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.octality.com/pipermail/cherokee/attachments/20120612/f71e900a/attachment-0001.html>

------------------------------

Message: 2
Date: Tue, 12 Jun 2012 16:26:51 +0200
From: Bertrand FRUCHET <astebert@gmail.com>
To: cherokee@lists.octality.com
Subject: [Cherokee] Translate HTAccess regexp in cherokee
Message-ID: <4FD751AB.4070608@gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi,

I installed opencart (http://www.opencart.com) on my cherokee web server

First, i want to activate SEO URLs. Opencart give me an htaccess file
but i don't know how to "translate" the rewrite rules in cherokee.
Here is the content of opencart htaccess :

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

Because i'm not a regexp expert, i use http://www.regextester.com/ to
help me , but it's not working.
Can someone help me ?

Second,
Opencart says that this two php flags will be activate in some cases :

# php_flag register_globals off
# php_flag magic_quotes_gpc Off

I think i will be make a special php source with theses parameters or Is
there another method ?

Thanks in advance,
Bertrand (French system admin)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.octality.com/pipermail/cherokee/attachments/20120612/c61f3701/attachment-0001.html>

------------------------------

Message: 3
Date: Tue, 12 Jun 2012 16:38:19 +0200 (CEST)
From: Stefan de Konink <stefan@konink.de>
To: Bertrand FRUCHET <astebert@gmail.com>
Cc: cherokee@lists.octality.com
Subject: Re: [Cherokee] Translate HTAccess regexp in cherokee
Message-ID: <alpine.LNX.2.00.1206121636540.4667@localhost>
Content-Type: text/plain; charset="us-ascii"; Format="flowed"

On Tue, 12 Jun 2012, Bertrand FRUCHET wrote:

> RewriteEngine On
> RewriteBase /
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

Only the last line is a regular expression, and actually... the point is
that you should know what these rules do. It seems that a simple:

FileExist => List & Send
Default => Redirection, Internal ^/(.*) => index.php?_route_=$1

...could already do the trick.


Stefan
-------------- next part --------------
_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee


!DSPAM:1,4fd74f21199536468934314!

------------------------------

Message: 4
Date: Tue, 12 Jun 2012 16:41:06 +0200
From: kevin danezis <kdanezis@gmail.com>
To: Stefan de Konink <stefan@konink.de>
Cc: Bertrand FRUCHET <astebert@gmail.com>, cherokee@lists.octality.com
Subject: Re: [Cherokee] Translate HTAccess regexp in cherokee
Message-ID:
<CAPx0SSVJQE-0J_gQhTo0OW5P2CE_k+T8T4CxeJ84_AdxS4iguA@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

It may help you : (in French)

http://www.furie.be/news/16/15/Cherokee-et-CmsMadeSimple.html

we had about the same .htaccess

2012/6/12 Stefan de Konink <stefan@konink.de>

> On Tue, 12 Jun 2012, Bertrand FRUCHET wrote:
>
> RewriteEngine On
>> RewriteBase /
>> RewriteCond %{REQUEST_FILENAME} !-f
>> RewriteCond %{REQUEST_FILENAME} !-d
>> RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
>>
>
> Only the last line is a regular expression, and actually... the point is
> that you should know what these rules do. It seems that a simple:
>
> FileExist => List & Send
> Default => Redirection, Internal ^/(.*) => index.php?_route_=$1
>
> ...could already do the trick.
>
>
> Stefan
> _______________________________________________
> Cherokee mailing list
> Cherokee@lists.octality.com
> http://lists.octality.com/listinfo/cherokee
>
>
> !DSPAM:1,4fd74f21199536468934314!
>
> _______________________________________________
> Cherokee mailing list
> Cherokee@lists.octality.com
> http://lists.octality.com/listinfo/cherokee
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.octality.com/pipermail/cherokee/attachments/20120612/276d4c0f/attachment-0001.html>

------------------------------

Message: 5
Date: Tue, 12 Jun 2012 16:41:27 +0200
From: PChott <pchott@gmail.com>
To: Bertrand FRUCHET <astebert@gmail.com>
Cc: cherokee@lists.octality.com
Subject: Re: [Cherokee] Translate HTAccess regexp in cherokee
Message-ID:
<CACEw2Dz2RrzCCaJ+WdsqUD5XA9dNu-whBxKn3YpS3U+kcBVMZA@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Hi,

i have clone (Tomato Card) running Cherokee and works fine.

In php i suggest using fpm. Also you can run more php-fpm, if you
really need special config for some pages. I think php_flag
magic_quotes_gpc is depriciate.

Regards,
Jan

On Tue, Jun 12, 2012 at 4:26 PM, Bertrand FRUCHET <astebert@gmail.com> wrote:
> Hi,
>
> I installed opencart (http://www.opencart.com) on my cherokee web server
>
> First, i want to activate SEO URLs. Opencart give me an htaccess file but i
> don't know how to "translate" the rewrite rules in cherokee.
> Here is the content of opencart htaccess :
>
> RewriteEngine On
> RewriteBase /
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
>
> Because i'm not a regexp expert, i use http://www.regextester.com/ to help
> me , but it's not working.
> Can someone help me ?
>
> Second,
> ?Opencart says that this two php flags will be activate in some cases :
>
> # php_flag register_globals off
> # php_flag magic_quotes_gpc Off
>
> I think i will be make a special php source with theses parameters or Is
> there another method ?
>
> Thanks in advance,
> Bertrand (French system admin)
>
>
>
> _______________________________________________
> Cherokee mailing list
> Cherokee@lists.octality.com
> http://lists.octality.com/listinfo/cherokee
>


------------------------------

Message: 6
Date: Tue, 12 Jun 2012 11:22:27 -0400
From: Locke Bircher <locke@gigbureau.com>
To: Bertrand FRUCHET <astebert@gmail.com>
Cc: cherokee@lists.octality.com
Subject: Re: [Cherokee] Translate HTAccess regexp in cherokee
Message-ID:
<CAHTAg-a0c+YTUCJjj85+kLtQgOLH=SFhQ6Vr-8a_-q57jqFoBg@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

A new PHP install will not have have problems with register_globals or
magic_quotes_gpc.

As Stefan said, a rule to serve static files and then do an internal
redirect of everything else to index.php should do the trick.

Something like this:
http://img191.imageshack.us/img191/6828/rewriterulesg.png

Lastly, I'm not sure how Open Cart works, but you may need to change the
"index.php?_route_=$1" to "index.php?_route_=/$1" (note the slash).

-Locke

On Tue, Jun 12, 2012 at 10:26 AM, Bertrand FRUCHET <astebert@gmail.com>wrote:

> Hi,
>
> I installed opencart (http://www.opencart.com) on my cherokee web server
>
> First, i want to activate SEO URLs. Opencart give me an htaccess file but
> i don't know how to "translate" the rewrite rules in cherokee.
> Here is the content of opencart htaccess :
>
> RewriteEngine On
> RewriteBase /
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
>
> Because i'm not a regexp expert, i use http://www.regextester.com/ to
> help me , but it's not working.
> Can someone help me ?
>
> Second,
> Opencart says that this two php flags will be activate in some cases :
>
> # php_flag register_globals off
> # php_flag magic_quotes_gpc Off
>
> I think i will be make a special php source with theses parameters or Is
> there another method ?
>
> Thanks in advance,
> Bertrand (French system admin)
>
>
>
> _______________________________________________
> Cherokee mailing list
> Cherokee@lists.octality.com
> http://lists.octality.com/listinfo/cherokee
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.octality.com/pipermail/cherokee/attachments/20120612/fcbcb237/attachment.html>

------------------------------

_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee


End of Cherokee Digest, Vol 48, Issue 5
***************************************