Apache Rewrite Question
Hi all, I am using apache with Redhat 6.0, I have to do some Conditions and Rules that is a challenge for me. I already tried a lot of combinations, now my httpd.conf is like this: RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/(.*) /home/httpd/cgi-bin/Zope.cgi/myfolder/$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] This works fine, the site begins at myfolder/ this why I put Zope.cgi/myfolder/$1 but I already realized that is not the best way to do it because if I want to access the manage interface I get the content from /myfolder/manage. So I have to access the content of /manage and not /myfolder/manage, ok then I made this lines: RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/manage(.*) /home/httpd/cgi-bin/Zope.cgi/manage$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] RewriteRule ^/(.*) /home/httpd/cgi-bin/Zope.cgi/myfolder/$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] But didnt worked, then I tried: RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteCond $1 !^man/ RewriteRule ^/man/(.*) /home/httpd/cgi-bin/Zope.cgi/manage$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] RewriteRule ^/(.*) /home/httpd/cgi-bin/Zope.cgi/myfolder/$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] And didnt worked too, am I going in the right way ? Someone can help me ? How can I deal with differents folders, because my problem is if I have a domain zope.hiper.com.br and I made all Documents and Methods inside the folder /zope/ I dont want to have a domain zope.hiper.com.br/zope/ right ? but I still want to access the another folder in the same level that the /zope/ is like zope.hiper.com.br/zope2/ but to do that I have to fix my Rewrite, Am I clear ? Thanxs a lot, -- Ze Octavio -- Hiperlógica Automação de web-sites | Web-site automation São Paulo | Brasil | Fone: +55-11-251-4894
Then, let's try it: RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/(.*) /home/httpd/cgi-bin/Zope.cgi/$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] That works? Ze Octavio wrote:
Hi all,
I am using apache with Redhat 6.0, I have to do some Conditions and Rules that is a challenge for me. I already tried a lot of combinations, now my httpd.conf is like this:
RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/(.*) /home/httpd/cgi-bin/Zope.cgi/myfolder/$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l]
This works fine, the site begins at myfolder/ this why I put Zope.cgi/myfolder/$1 but I already realized that is not the best way to do it because if I want to access the manage interface I get the content from /myfolder/manage. So I have to access the content of /manage and not /myfolder/manage, ok then I made this lines:
RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/manage(.*) /home/httpd/cgi-bin/Zope.cgi/manage$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] RewriteRule ^/(.*) /home/httpd/cgi-bin/Zope.cgi/myfolder/$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l]
But didnt worked, then I tried: RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteCond $1 !^man/ RewriteRule ^/man/(.*) /home/httpd/cgi-bin/Zope.cgi/manage$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] RewriteRule ^/(.*) /home/httpd/cgi-bin/Zope.cgi/myfolder/$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l]
And didnt worked too, am I going in the right way ? Someone can help me ?
How can I deal with differents folders, because my problem is if I have a domain zope.hiper.com.br and I made all Documents and Methods inside the folder /zope/ I dont want to have a domain zope.hiper.com.br/zope/ right ? but I still want to access the another folder in the same level that the /zope/ is like zope.hiper.com.br/zope2/ but to do that I have to fix my Rewrite, Am I clear ?
Thanxs a lot,
-- Mauricio Souza Lima <mauricio@hiper.com.br> Hiperlógica <http://hiper.com.br> Automação de web-sites | Website automation São Paulo | Brasil | Fone: +55-11-251-4894
participants (2)
-
Mauricio -
Ze Octavio