You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Alexis <ra...@gmail.com> on 2009/08/12 14:12:16 UTC

[users@httpd] Using Rewrite

Hello Friend of the list,

I am here with little problem that I could not settle after a while.

The situation is this: I have a directory with some content and save
time to write the full address of each of them occurred to me to take a
direction,
but when I test the url of the files sends me to root directory of the
site.

Part of the code .htaccess root of

RewriteCond %{HTTP_HOST} ^files\.example\.com$ [NC] RewriteBase
/files/public RewriteRule ^(.*)$ $1 [L]

When treated with the url http://files.example.com/archivo.txt , this send
me to the server root,
and the log appears the following File does not exist:
/home/example/public_html/archivo.txt

If I understand, I ask you to help me solve this, I thank you in advance
your help.

-- 
Alexis Beltran
blog: http://blexis.net

Re: [users@httpd] Using Rewrite

Posted by Krist van Besien <kr...@gmail.com>.
On Thu, Aug 13, 2009 at 12:30 AM, Ya Netu<ec...@hotmail.com> wrote:
> i have some waht similar questiin for debuging my rewrite policy:
> How can I tell if my rewrite is being executed if I get 404 error. Any way
> to trce if rules is executed and that it was trying to do redirect? tnx

Yes. Set a Rewrite Log.

Krist


-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Using Rewrite

Posted by Ya Netu <ec...@hotmail.com>.
i have some waht similar questiin for debuging my rewrite policy:

How can I tell if my rewrite is being executed if I get 404 error. Any way to trce if rules is executed and that it was trying to do redirect? tnx
 
> From: bobsiegen@googlemail.com
> Date: Wed, 12 Aug 2009 21:20:24 +0200
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Using Rewrite
> 
> 2009/8/12 Alexis <ra...@gmail.com>:
> > ok, then the code would be
> > RewriteCond %{HTTP_HOST} ^files\.example\.com$ [NC] RewriteRule ^(.*)$
> > /files/public$1 [L]
> > or am i wrong?
> 
> Unless you put RewriteEngine off in a .htaccess file located in your
> files/public/ folder, that would result in an infinite loop. But only
> if you correct your rule. Since there is no leading slash in the
> string tested against your regular expression in .htaccess files,
> you'd rewrite to /files/publicarchivo.txt instead of
> /files/public/archivo.txt
> 
> # we can change to a lex. equal comparison here
> RewriteCond %{HTTP_HOST} =files.example.com [NC]
> # exclude th folder
> RewriteCond $1 !^/files/public/
> RewriteRule ^(.*) /files/public/$1 [L]
> 
> 
> Setting the DocumentRoot for files.example.com in your httpd.conf to
> /home/example/public_html/files/public would be another (may be the
> regular) approach.
> 
> Bob
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

_________________________________________________________________
Get back to school stuff for them and cashback for you.
http://www.bing.com/cashback?form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1

RE: [users@httpd] Using Rewrite

Posted by Ya Netu <ec...@hotmail.com>.
i guess thta what i have to do

tnx
 
> Date: Thu, 13 Aug 2009 14:50:06 -0400
> From: francois.gingras@gmail.com
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Using Rewrite
> 
> In that case, you should replicate the site on a local development 
> server, and test at your leisure there.
> 
> Frank.
> 
> Ya Netu wrote:
> > i guess that is impossible under shared hosting :(
> > 
> > > Date: Thu, 13 Aug 2009 14:38:52 -0400
> > > From: francois.gingras@gmail.com
> > > To: users@httpd.apache.org
> > > Subject: Re: [users@httpd] Using Rewrite
> > >
> > > You would place it in your config file, in your <VirtualHost>
> > > </VirtualHost> section.
> > >
> > > If you don't have any virtual host, the main config file will do.
> > >
> > > Frank.
> > >
> > > Ya Netu wrote:
> > > > damn, ok then how do i actiavte it?
> > > >
> > > > > Date: Thu, 13 Aug 2009 14:35:33 -0400
> > > > > From: francois.gingras@gmail.com
> > > > > To: users@httpd.apache.org
> > > > > Subject: Re: [users@httpd] Using Rewrite
> > > > >
> > > > > Ya,
> > > > >
> > > > > You can't use RewriteLog in .htaccess.
> > > > >
> > > > > Frank.
> > > > >
> > > > > Ya Netu wrote:
> > > > > > same here,
> > > > > > when i was trying to add this line:
> > > > > >
> > > > > > RewriteLog "AA/rewrite.log"
> > > > > >
> > > > > > To trace why my rewrite did not work, I got 500 Internal server 
> > error.
> > > > > > Any ideas what could be causing it? I tried adding leading slash
> > > > but no
> > > > > > luck... the ath is relative to location of my .htaccess file.
> > > > > >
> > > > > > TNX for help
> > > > > > Date: Thu, 13 Aug 2009 11:37:05 -0600
> > > > > > From: rab4585@gmail.com
> > > > > > To: users@httpd.apache.org
> > > > > > Subject: Re: [users@httpd] Using Rewrite
> > > > > >
> > > > > > Bob thank you, but i receiving a new error me ssage the http 
> > 500 and I
> > > > > > do not have access to httpd.conf and also do not know how.
> > > > > >
> > > > > > 2009/8/12 Bob Ionescu <bo...@googlemail.com>
> > > > > >
> > > > > > 2009/8/12 Alexis <ra...@gmail.com>:
> > > > > > > ok, then the code would be
> > > > > > > RewriteCond %{HTTP_HOST} ^files\.example\.com$ [NC] RewriteRule
> > > > > > ^(.*)$
> > > > > > > /files/public$1 [L]
> > > > > > > or am i wrong?
> > > > > >
> > > > > > Unless you put RewriteEngine off in a .htaccess file located in 
> > your
> > > > > > files/public/ folder, that would result in an infinite loop. 
> > But only
> > > > > > if you correct your rule. Since there is no leading slash in the
> > > > > > string tested against your regular expression in .htaccess files,
> > > > > > you'd rewrite to /files/publicarchivo.txt instead of
> > > > > > /files/public/archivo.txt
> > > > > >
> > > > > > # we can change to a lex. equal comparison here
> > > > > > RewriteCond %{HTTP_HOST} =files.example.com [NC]
> > > > > > # exclude th folder
> > > > > > RewriteCond $1 !^/files/public/
> > > > > > RewriteRule ^(.*) /files/public/$1 [L]
> > > > > >
> > > > > >
> > > > > > Setting the DocumentRoot for files.example.com in your 
> > httpd.conf to
> > > > > > /home/example/public_html/files/public would be another (may be the
> > > > > > regular) approach.
> > > > > >
> > > > > > Bob
> > > > > >
> > > > > > 
> > ---------------------------------------------------------------------
> > > > > > The official User-To-User support forum of the Apache HTTP Server
> > > > > > Project.
> > > > > > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > > > > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > > > > > " from the digest: users-digest-unsubscribe@httpd.apache.org
> > > > > > For additional commands, e-mail: users-help@httpd.apache.org
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Alexis Beltran
> > > > > > skype: blexis.sv
> > > > > > blog: http://blexis.net
> > > > > >
> > > > > > Express your personality in color! Preview and select themes for
> > > > > > Hotmail®. Try it now.
> > > > > >
> > > > 
> > <http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_express:082009>
> > > > >
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > The official User-To-User support forum of the Apache HTTP Server
> > > > Project.
> > > > > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > > > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > > > > " from the digest: users-digest-unsubscribe@httpd.apache.org
> > > > > For additional commands, e-mail: users-help@httpd.apache.org
> > > > >
> > > >
> > > > Get your vacation photos on your phone! Click here.
> > > > 
> > <http://windowsliveformobile.com/en-us/photos/default.aspx?&OCID=0809TL-HM>
> > >
> > >
> > > ---------------------------------------------------------------------
> > > The official User-To-User support forum of the Apache HTTP Server 
> > Project.
> > > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > > " from the digest: users-digest-unsubscribe@httpd.apache.org
> > > For additional commands, e-mail: users-help@httpd.apache.org
> > >
> > 
> > Windows Live™: Keep your life in sync. Check it out. 
> > <http://windowslive.com/explore?ocid=PID23384::T:WLMTAGL:ON:WL:en-US:NF_BR_sync:082009>
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

_________________________________________________________________
Get free photo software from Windows Live
http://www.windowslive.com/online/photos?ocid=PID23393::T:WLMTAGL:ON:WL:en-US:SI_PH_software:082009

Re: [users@httpd] Using Rewrite

Posted by Frank Gingras <fr...@gmail.com>.
In that case, you should replicate the site on a local development 
server, and test at your leisure there.

Frank.

Ya Netu wrote:
>   i guess that is impossible under shared hosting :(
>  
>  > Date: Thu, 13 Aug 2009 14:38:52 -0400
>  > From: francois.gingras@gmail.com
>  > To: users@httpd.apache.org
>  > Subject: Re: [users@httpd] Using Rewrite
>  >
>  > You would place it in your config file, in your <VirtualHost>
>  > </VirtualHost> section.
>  >
>  > If you don't have any virtual host, the main config file will do.
>  >
>  > Frank.
>  >
>  > Ya Netu wrote:
>  > > damn, ok then how do i actiavte it?
>  > >
>  > > > Date: Thu, 13 Aug 2009 14:35:33 -0400
>  > > > From: francois.gingras@gmail.com
>  > > > To: users@httpd.apache.org
>  > > > Subject: Re: [users@httpd] Using Rewrite
>  > > >
>  > > > Ya,
>  > > >
>  > > > You can't use RewriteLog in .htaccess.
>  > > >
>  > > > Frank.
>  > > >
>  > > > Ya Netu wrote:
>  > > > > same here,
>  > > > > when i was trying to add this line:
>  > > > >
>  > > > > RewriteLog "AA/rewrite.log"
>  > > > >
>  > > > > To trace why my rewrite did not work, I got 500 Internal server 
> error.
>  > > > > Any ideas what could be causing it? I tried adding leading slash
>  > > but no
>  > > > > luck... the ath is relative to location of my .htaccess file.
>  > > > >
>  > > > > TNX for help
>  > > > > Date: Thu, 13 Aug 2009 11:37:05 -0600
>  > > > > From: rab4585@gmail.com
>  > > > > To: users@httpd.apache.org
>  > > > > Subject: Re: [users@httpd] Using Rewrite
>  > > > >
>  > > > > Bob thank you, but i receiving a new error me ssage the http 
> 500 and I
>  > > > > do not have access to httpd.conf and also do not know how.
>  > > > >
>  > > > > 2009/8/12 Bob Ionescu <bo...@googlemail.com>
>  > > > >
>  > > > > 2009/8/12 Alexis <ra...@gmail.com>:
>  > > > > > ok, then the code would be
>  > > > > > RewriteCond %{HTTP_HOST} ^files\.example\.com$ [NC] RewriteRule
>  > > > > ^(.*)$
>  > > > > > /files/public$1 [L]
>  > > > > > or am i wrong?
>  > > > >
>  > > > > Unless you put RewriteEngine off in a .htaccess file located in 
> your
>  > > > > files/public/ folder, that would result in an infinite loop. 
> But only
>  > > > > if you correct your rule. Since there is no leading slash in the
>  > > > > string tested against your regular expression in .htaccess files,
>  > > > > you'd rewrite to /files/publicarchivo.txt instead of
>  > > > > /files/public/archivo.txt
>  > > > >
>  > > > > # we can change to a lex. equal comparison here
>  > > > > RewriteCond %{HTTP_HOST} =files.example.com [NC]
>  > > > > # exclude th folder
>  > > > > RewriteCond $1 !^/files/public/
>  > > > > RewriteRule ^(.*) /files/public/$1 [L]
>  > > > >
>  > > > >
>  > > > > Setting the DocumentRoot for files.example.com in your 
> httpd.conf to
>  > > > > /home/example/public_html/files/public would be another (may be the
>  > > > > regular) approach.
>  > > > >
>  > > > > Bob
>  > > > >
>  > > > > 
> ---------------------------------------------------------------------
>  > > > > The official User-To-User support forum of the Apache HTTP Server
>  > > > > Project.
>  > > > > See <URL:http://httpd.apache.org/userslist.html> for more info.
>  > > > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>  > > > > " from the digest: users-digest-unsubscribe@httpd.apache.org
>  > > > > For additional commands, e-mail: users-help@httpd.apache.org
>  > > > >
>  > > > >
>  > > > >
>  > > > >
>  > > > > --
>  > > > > Alexis Beltran
>  > > > > skype: blexis.sv
>  > > > > blog: http://blexis.net
>  > > > >
>  > > > > Express your personality in color! Preview and select themes for
>  > > > > Hotmail®. Try it now.
>  > > > >
>  > > 
> <http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_express:082009>
>  > > >
>  > > >
>  > > > ---------------------------------------------------------------------
>  > > > The official User-To-User support forum of the Apache HTTP Server
>  > > Project.
>  > > > See <URL:http://httpd.apache.org/userslist.html> for more info.
>  > > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>  > > > " from the digest: users-digest-unsubscribe@httpd.apache.org
>  > > > For additional commands, e-mail: users-help@httpd.apache.org
>  > > >
>  > >
>  > > Get your vacation photos on your phone! Click here.
>  > > 
> <http://windowsliveformobile.com/en-us/photos/default.aspx?&OCID=0809TL-HM>
>  >
>  >
>  > ---------------------------------------------------------------------
>  > The official User-To-User support forum of the Apache HTTP Server 
> Project.
>  > See <URL:http://httpd.apache.org/userslist.html> for more info.
>  > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>  > " from the digest: users-digest-unsubscribe@httpd.apache.org
>  > For additional commands, e-mail: users-help@httpd.apache.org
>  >
> 
> Windows Live™: Keep your life in sync. Check it out. 
> <http://windowslive.com/explore?ocid=PID23384::T:WLMTAGL:ON:WL:en-US:NF_BR_sync:082009>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Using Rewrite

Posted by Ya Netu <ec...@hotmail.com>.
i guess that is impossible under shared hosting :(
 
> Date: Thu, 13 Aug 2009 14:38:52 -0400
> From: francois.gingras@gmail.com
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Using Rewrite
> 
> You would place it in your config file, in your <VirtualHost> 
> </VirtualHost> section.
> 
> If you don't have any virtual host, the main config file will do.
> 
> Frank.
> 
> Ya Netu wrote:
> > damn, ok then how do i actiavte it?
> > 
> > > Date: Thu, 13 Aug 2009 14:35:33 -0400
> > > From: francois.gingras@gmail.com
> > > To: users@httpd.apache.org
> > > Subject: Re: [users@httpd] Using Rewrite
> > >
> > > Ya,
> > >
> > > You can't use RewriteLog in .htaccess.
> > >
> > > Frank.
> > >
> > > Ya Netu wrote:
> > > > same here,
> > > > when i was trying to add this line:
> > > >
> > > > RewriteLog "AA/rewrite.log"
> > > >
> > > > To trace why my rewrite did not work, I got 500 Internal server error.
> > > > Any ideas what could be causing it? I tried adding leading slash 
> > but no
> > > > luck... the ath is relative to location of my .htaccess file.
> > > >
> > > > TNX for help
> > > > Date: Thu, 13 Aug 2009 11:37:05 -0600
> > > > From: rab4585@gmail.com
> > > > To: users@httpd.apache.org
> > > > Subject: Re: [users@httpd] Using Rewrite
> > > >
> > > > Bob thank you, but i receiving a new error me ssage the http 500 and I
> > > > do not have access to httpd.conf and also do not know how.
> > > >
> > > > 2009/8/12 Bob Ionescu <bo...@googlemail.com>
> > > >
> > > > 2009/8/12 Alexis <ra...@gmail.com>:
> > > > > ok, then the code would be
> > > > > RewriteCond %{HTTP_HOST} ^files\.example\.com$ [NC] RewriteRule
> > > > ^(.*)$
> > > > > /files/public$1 [L]
> > > > > or am i wrong?
> > > >
> > > > Unless you put RewriteEngine off in a .htaccess file located in your
> > > > files/public/ folder, that would result in an infinite loop. But only
> > > > if you correct your rule. Since there is no leading slash in the
> > > > string tested against your regular expression in .htaccess files,
> > > > you'd rewrite to /files/publicarchivo.txt instead of
> > > > /files/public/archivo.txt
> > > >
> > > > # we can change to a lex. equal comparison here
> > > > RewriteCond %{HTTP_HOST} =files.example.com [NC]
> > > > # exclude th folder
> > > > RewriteCond $1 !^/files/public/
> > > > RewriteRule ^(.*) /files/public/$1 [L]
> > > >
> > > >
> > > > Setting the DocumentRoot for files.example.com in your httpd.conf to
> > > > /home/example/public_html/files/public would be another (may be the
> > > > regular) approach.
> > > >
> > > > Bob
> > > >
> > > > ---------------------------------------------------------------------
> > > > The official User-To-User support forum of the Apache HTTP Server
> > > > Project.
> > > > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > > > " from the digest: users-digest-unsubscribe@httpd.apache.org
> > > > For additional commands, e-mail: users-help@httpd.apache.org
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Alexis Beltran
> > > > skype: blexis.sv
> > > > blog: http://blexis.net
> > > >
> > > > Express your personality in color! Preview and select themes for
> > > > Hotmail®. Try it now.
> > > > 
> > <http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_express:082009>
> > >
> > >
> > > ---------------------------------------------------------------------
> > > The official User-To-User support forum of the Apache HTTP Server 
> > Project.
> > > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > > " from the digest: users-digest-unsubscribe@httpd.apache.org
> > > For additional commands, e-mail: users-help@httpd.apache.org
> > >
> > 
> > Get your vacation photos on your phone! Click here. 
> > <http://windowsliveformobile.com/en-us/photos/default.aspx?&OCID=0809TL-HM>
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

_________________________________________________________________
Windows Live™: Keep your life in sync.
http://windowslive.com/explore?ocid=PID23384::T:WLMTAGL:ON:WL:en-US:NF_BR_sync:082009

Re: [users@httpd] Using Rewrite

Posted by Frank Gingras <fr...@gmail.com>.
You would place it in your config file, in your <VirtualHost> 
</VirtualHost> section.

If you don't have any virtual host, the main config file will do.

Frank.

Ya Netu wrote:
>   damn, ok then how do i actiavte it?
>  
>  > Date: Thu, 13 Aug 2009 14:35:33 -0400
>  > From: francois.gingras@gmail.com
>  > To: users@httpd.apache.org
>  > Subject: Re: [users@httpd] Using Rewrite
>  >
>  > Ya,
>  >
>  > You can't use RewriteLog in .htaccess.
>  >
>  > Frank.
>  >
>  > Ya Netu wrote:
>  > > same here,
>  > > when i was trying to add this line:
>  > >
>  > > RewriteLog "AA/rewrite.log"
>  > >
>  > > To trace why my rewrite did not work, I got 500 Internal server error.
>  > > Any ideas what could be causing it? I tried adding leading slash 
> but no
>  > > luck... the ath is relative to location of my .htaccess file.
>  > >
>  > > TNX for help
>  > > Date: Thu, 13 Aug 2009 11:37:05 -0600
>  > > From: rab4585@gmail.com
>  > > To: users@httpd.apache.org
>  > > Subject: Re: [users@httpd] Using Rewrite
>  > >
>  > > Bob thank you, but i receiving a new error me ssage the http 500 and I
>  > > do not have access to httpd.conf and also do not know how.
>  > >
>  > > 2009/8/12 Bob Ionescu <bo...@googlemail.com>
>  > >
>  > > 2009/8/12 Alexis <ra...@gmail.com>:
>  > > > ok, then the code would be
>  > > > RewriteCond %{HTTP_HOST} ^files\.example\.com$ [NC] RewriteRule
>  > > ^(.*)$
>  > > > /files/public$1 [L]
>  > > > or am i wrong?
>  > >
>  > > Unless you put RewriteEngine off in a .htaccess file located in your
>  > > files/public/ folder, that would result in an infinite loop. But only
>  > > if you correct your rule. Since there is no leading slash in the
>  > > string tested against your regular expression in .htaccess files,
>  > > you'd rewrite to /files/publicarchivo.txt instead of
>  > > /files/public/archivo.txt
>  > >
>  > > # we can change to a lex. equal comparison here
>  > > RewriteCond %{HTTP_HOST} =files.example.com [NC]
>  > > # exclude th folder
>  > > RewriteCond $1 !^/files/public/
>  > > RewriteRule ^(.*) /files/public/$1 [L]
>  > >
>  > >
>  > > Setting the DocumentRoot for files.example.com in your httpd.conf to
>  > > /home/example/public_html/files/public would be another (may be the
>  > > regular) approach.
>  > >
>  > > Bob
>  > >
>  > > ---------------------------------------------------------------------
>  > > The official User-To-User support forum of the Apache HTTP Server
>  > > Project.
>  > > See <URL:http://httpd.apache.org/userslist.html> for more info.
>  > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>  > > " from the digest: users-digest-unsubscribe@httpd.apache.org
>  > > For additional commands, e-mail: users-help@httpd.apache.org
>  > >
>  > >
>  > >
>  > >
>  > > --
>  > > Alexis Beltran
>  > > skype: blexis.sv
>  > > blog: http://blexis.net
>  > >
>  > > Express your personality in color! Preview and select themes for
>  > > Hotmail®. Try it now.
>  > > 
> <http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_express:082009>
>  >
>  >
>  > ---------------------------------------------------------------------
>  > The official User-To-User support forum of the Apache HTTP Server 
> Project.
>  > See <URL:http://httpd.apache.org/userslist.html> for more info.
>  > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>  > " from the digest: users-digest-unsubscribe@httpd.apache.org
>  > For additional commands, e-mail: users-help@httpd.apache.org
>  >
> 
> Get your vacation photos on your phone! Click here. 
> <http://windowsliveformobile.com/en-us/photos/default.aspx?&OCID=0809TL-HM>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Using Rewrite

Posted by Ya Netu <ec...@hotmail.com>.
damn, ok then how do i actiavte it?
 
> Date: Thu, 13 Aug 2009 14:35:33 -0400
> From: francois.gingras@gmail.com
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Using Rewrite
> 
> Ya,
> 
> You can't use RewriteLog in .htaccess.
> 
> Frank.
> 
> Ya Netu wrote:
> > same here,
> > when i was trying to add this line:
> > 
> > RewriteLog "AA/rewrite.log"
> > 
> > To trace why my rewrite did not work, I got 500 Internal server error.
> > Any ideas what could be causing it? I tried adding leading slash but no 
> > luck... the ath is relative to location of my .htaccess file.
> > 
> > TNX for help 
> > Date: Thu, 13 Aug 2009 11:37:05 -0600
> > From: rab4585@gmail.com
> > To: users@httpd.apache.org
> > Subject: Re: [users@httpd] Using Rewrite
> > 
> > Bob thank you, but i receiving a new error me ssage the http 500 and I 
> > do not have access to httpd.conf and also do not know how.
> > 
> > 2009/8/12 Bob Ionescu <bo...@googlemail.com>
> > 
> > 2009/8/12 Alexis <ra...@gmail.com>:
> > > ok, then the code would be
> > > RewriteCond %{HTTP_HOST} ^files\.example\.com$ [NC] RewriteRule
> > ^(.*)$
> > > /files/public$1 [L]
> > > or am i wrong?
> > 
> > Unless you put RewriteEngine off in a .htaccess file located in your
> > files/public/ folder, that would result in an infinite loop. But only
> > if you correct your rule. Since there is no leading slash in the
> > string tested against your regular expression in .htaccess files,
> > you'd rewrite to /files/publicarchivo.txt instead of
> > /files/public/archivo.txt
> > 
> > # we can change to a lex. equal comparison here
> > RewriteCond %{HTTP_HOST} =files.example.com [NC]
> > # exclude th folder
> > RewriteCond $1 !^/files/public/
> > RewriteRule ^(.*) /files/public/$1 [L]
> > 
> > 
> > Setting the DocumentRoot for files.example.com in your httpd.conf to
> > /home/example/public_html/files/public would be another (may be the
> > regular) approach.
> > 
> > Bob
> > 
> > ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP Server
> > Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > " from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> > 
> > 
> > 
> > 
> > -- 
> > Alexis Beltran
> > skype: blexis.sv
> > blog: http://blexis.net
> > 
> > Express your personality in color! Preview and select themes for 
> > Hotmail®. Try it now. 
> > <http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_express:082009>
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

_________________________________________________________________
Get your vacation photos on your phone!
http://windowsliveformobile.com/en-us/photos/default.aspx?&OCID=0809TL-HM

Re: [users@httpd] Using Rewrite

Posted by Frank Gingras <fr...@gmail.com>.
Ya,

You can't use RewriteLog in .htaccess.

Frank.

Ya Netu wrote:
>   same here,
> when i was trying to add this line:
> 
> RewriteLog "AA/rewrite.log"
> 
> To trace why my rewrite did not work, I got 500 Internal server error.
> Any ideas what could be causing it? I tried adding leading slash but no 
> luck... the ath is relative to location of my  .htaccess file.
>  
> TNX for help 
> Date: Thu, 13 Aug 2009 11:37:05 -0600
> From: rab4585@gmail.com
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Using Rewrite
> 
> Bob thank you, but i receiving a new error me ssage the http 500  and I 
> do not have access to httpd.conf and also do not know how.
> 
> 2009/8/12 Bob Ionescu <bo...@googlemail.com>
> 
>     2009/8/12 Alexis <ra...@gmail.com>:
>      > ok, then the code would be
>      > RewriteCond %{HTTP_HOST} ^files\.example\.com$ [NC] RewriteRule
>     ^(.*)$
>      > /files/public$1 [L]
>      > or am i wrong?
> 
>     Unless you put RewriteEngine off in a .htaccess file located in your
>     files/public/ folder, that would result in an infinite loop. But only
>     if you correct your rule. Since there is no leading slash in the
>     string tested against your regular expression in .htaccess files,
>     you'd rewrite to /files/publicarchivo.txt instead of
>     /files/public/archivo.txt
> 
>     # we can change to a lex. equal comparison here
>     RewriteCond %{HTTP_HOST} =files.example.com [NC]
>     # exclude th folder
>     RewriteCond $1 !^/files/public/
>     RewriteRule ^(.*) /files/public/$1 [L]
> 
> 
>     Setting the DocumentRoot for files.example.com in your httpd.conf to
>     /home/example/public_html/files/public would be another (may be the
>     regular) approach.
> 
>     Bob
> 
>     ---------------------------------------------------------------------
>     The official User-To-User support forum of the Apache HTTP Server
>     Project.
>     See <URL:http://httpd.apache.org/userslist.html> for more info.
>     To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>       "   from the digest: users-digest-unsubscribe@httpd.apache.org
>     For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 
> 
> -- 
> Alexis Beltran
> skype: blexis.sv
> blog: http://blexis.net
> 
> Express your personality in color! Preview and select themes for 
> Hotmail®. Try it now. 
> <http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_express:082009>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Using Rewrite

Posted by Ya Netu <ec...@hotmail.com>.
same here,

when i was trying to add this line:


RewriteLog "AA/rewrite.log" 


To trace why my rewrite did not work, I got 500 Internal server error.

Any ideas what could be causing it? I tried adding leading slash but no luck... the ath is relative to location of my  .htaccess file.

 

TNX for help 


Date: Thu, 13 Aug 2009 11:37:05 -0600
From: rab4585@gmail.com
To: users@httpd.apache.org
Subject: Re: [users@httpd] Using Rewrite

Bob thank you, but i receiving a new error message the http 500 and I do not have access to httpd.conf and also do not know how.


2009/8/12 Bob Ionescu <bo...@googlemail.com>

2009/8/12 Alexis <ra...@gmail.com>:

> ok, then the code would be
> RewriteCond %{HTTP_HOST} ^files\.example\.com$ [NC] RewriteRule ^(.*)$
> /files/public$1 [L]
> or am i wrong?

Unless you put RewriteEngine off in a .htaccess file located in your
files/public/ folder, that would result in an infinite loop. But only
if you correct your rule. Since there is no leading slash in the
string tested against your regular expression in .htaccess files,
you'd rewrite to /files/publicarchivo.txt instead of
/files/public/archivo.txt

# we can change to a lex. equal comparison here

RewriteCond %{HTTP_HOST} =files.example.com [NC]
# exclude th folder
RewriteCond $1 !^/files/public/

RewriteRule ^(.*) /files/public/$1 [L]


Setting the DocumentRoot for files.example.com in your httpd.conf to
/home/example/public_html/files/public would be another (may be the
regular) approach.

Bob




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
  "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



-- 
Alexis Beltran
skype: blexis.sv
blog: http://blexis.net

_________________________________________________________________
Express your personality in color! Preview and select themes for Hotmail®. 
http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_express:082009

Re: [users@httpd] Using Rewrite

Posted by Alexis <ra...@gmail.com>.
Bob thank you, but i receiving a new error message the http 500 and I do not
have access to httpd.conf and also do not know how.

2009/8/12 Bob Ionescu <bo...@googlemail.com>

> 2009/8/12 Alexis <ra...@gmail.com>:
> > ok, then the code would be
> > RewriteCond %{HTTP_HOST} ^files\.example\.com$ [NC] RewriteRule ^(.*)$
> > /files/public$1 [L]
> > or am i wrong?
>
> Unless you put RewriteEngine off in a .htaccess file located in your
> files/public/ folder, that would result in an infinite loop. But only
> if you correct your rule. Since there is no leading slash in the
> string tested against your regular expression in .htaccess files,
> you'd rewrite to /files/publicarchivo.txt instead of
> /files/public/archivo.txt
>
> # we can change to a lex. equal comparison here
> RewriteCond %{HTTP_HOST} =files.example.com [NC]
> # exclude th folder
> RewriteCond $1 !^/files/public/
> RewriteRule ^(.*) /files/public/$1 [L]
>
>
> Setting the DocumentRoot for files.example.com in your httpd.conf to
> /home/example/public_html/files/public would be another (may be the
> regular) approach.
>
> Bob
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


-- 
Alexis Beltran
skype: blexis.sv
blog: http://blexis.net

Re: [users@httpd] Using Rewrite

Posted by Bob Ionescu <bo...@googlemail.com>.
2009/8/12 Alexis <ra...@gmail.com>:
> ok, then the code would be
> RewriteCond %{HTTP_HOST} ^files\.example\.com$ [NC] RewriteRule ^(.*)$
> /files/public$1 [L]
> or am i wrong?

Unless you put RewriteEngine off in a .htaccess file located in your
files/public/ folder, that would result in an infinite loop. But only
if you correct your rule. Since there is no leading slash in the
string tested against your regular expression in .htaccess files,
you'd rewrite to /files/publicarchivo.txt instead of
/files/public/archivo.txt

# we can change to a lex. equal comparison here
RewriteCond %{HTTP_HOST} =files.example.com [NC]
# exclude th folder
RewriteCond $1 !^/files/public/
RewriteRule ^(.*) /files/public/$1 [L]


Setting the DocumentRoot for files.example.com in your httpd.conf to
/home/example/public_html/files/public would be another (may be the
regular) approach.

Bob

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Using Rewrite

Posted by Alexis <ra...@gmail.com>.
ok, then the code would be
RewriteCond %{HTTP_HOST} ^files\.example\.com$ [NC] RewriteRule ^(.*)$
/files/public$1 [L]

or am i wrong?


2009/8/12 Eric Covener <co...@gmail.com>

> On Wed, Aug 12, 2009 at 8:12 AM, Alexis<ra...@gmail.com> wrote:
> > Hello Friend of the list,
> > RewriteBase /files/public
> > RewriteRule ^(.*)$ $1 [L]
> >
> > When treated with the url http://files.example.com/archivo.txt
>
> The RewriteBase isn't a base of what you want to rewrite to, it needs
> to reflect the base of where the htaccess itself is and is a factor in
> what you're matching as well.
>
>
> --
> Eric Covener
> covener@gmail.com
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


-- 
Alexis Beltran
skype: blexis.sv
blog: http://blexis.net

Re: [users@httpd] Using Rewrite

Posted by Eric Covener <co...@gmail.com>.
On Wed, Aug 12, 2009 at 8:12 AM, Alexis<ra...@gmail.com> wrote:
> Hello Friend of the list,
> RewriteBase /files/public
> RewriteRule ^(.*)$ $1 [L]
>
> When treated with the url http://files.example.com/archivo.txt

The RewriteBase isn't a base of what you want to rewrite to, it needs
to reflect the base of where the htaccess itself is and is a factor in
what you're matching as well.


-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org