  | |  | mod_rewrite help | mod_rewrite help 2005-01-20 - By Jean-Marc lachaine
Try the following in httpd.conf
<Directory "full/path/to/your/base/directory/imageview5/view/*"> ReWriteEngine on ReWriteCond %{SERVER_PORT} ^80$ ReWriteRule ^/($) http://schrauwen.no-ip.org/imageview5/index.php?album=$1 &file=$2 [R] </Directory>
This rule should take any port 80 request to anything contained in ../imageview /view/ and redirect it to the specified path. With obvious differences, this is what I use to redirect all requests to all folders and files in a specific directory to a different address. I may be mistaken but I think that the ReWriteCond condition is required. Also make sure that the LoadModule and AddModule entries for rewrite are uncommented.
Hope this helps.
JM ----- Original Message ----- From: Jorge Schrauwen To: users@(protected) Sent: Thursday, January 20, 2005 11:25 AM Subject: RE: [users@(protected)] Mod_rewrite help
yes, i always get errors!
and how would i turn on the loggin for mod_rewrite? i don't have it on.
Jorge
------------------------------------------------------------------------------ From: Sean T Allen [mailto:sean@(protected)] Sent: Thursday, January 20, 2005 17:05 To: users@(protected) Subject: Re: [users@(protected)] Mod_rewrite help
Are you getting the error all the time or only when going through a vhost...
Have you turned on mod rewrite logging to get a better idea of what is going on?
Jorge Schrauwen wrote: Yes, Main config -> http vhost -> https vhost2 -> DAV
Jorge
----------------------------------------------------------------------------
From: Sean T Allen [mailto:sean@(protected)] Sent: Thursday, January 20, 2005 16:33 To: users@(protected) Subject: Re: [users@(protected)] Mod_rewrite help
Then it probably is an issue somewhere else in your configuration...
Are you using virtual hosting?
Jorge Schrauwen wrote: nope adding the [R,L] didn't help :(
Jorge
-------------------------------------------------------------------------- From: Sean T Allen [mailto:sean@(protected)] Sent: Wednesday, January 19, 2005 22:48 To: users@(protected) Subject: Re: [users@(protected)] Mod_rewrite help
RewriteEngine on RewriteRule ^/imageview5/view/(.*)/(.*) http://schrauwen.no-ip.org/imageview5 /index.php?album=$1&file=$2 [R,L]
Jorge Schrauwen wrote: Ok now I have: --- RewriteEngine on RewriteRule ^/imageview5/view/(.*)/(.*) http://schrauwen.no-ip.org/imageview5/index.php?album=$1&file=$2 --- And it olso doesn't work, error log line is still the same.
Thanx again for the help
Jorg
-----Original Message----- From: Brian V Hughes [mailto:brianvh@(protected)] Sent: Wednesday, January 19, 2005 20:40 To: users@(protected) Subject: Re: [users@(protected)] Mod_rewrite help
Have you tried putting in a line to turn on Rewrite logging? That way you can look through the log file to see exactly what mod_rewrite is doing to the request URLs.
-Brian
On Jan 19, 2005, at 02:37 PM, Jorge Schrauwen wrote: No, still doesnt work, i still get a 404. I tried from .htaccess and httpd.conf, same result --- error.log --- [Wed Jan 19 20:34:10 2005] [error] [client 192.168.2.4] File does not exist: S:/wwwroot/imageview5/view thanx for the help though Jorge
--------------------------------------------------------------------- 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@(protected) " from the digest: users-digest-unsubscribe@(protected) For additional commands, e-mail: users-help@(protected)
--------------------------------------------------------------------- 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@(protected) " from the digest: users-digest-unsubscribe@(protected) For additional commands, e-mail: users-help@(protected)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <META content="MSHTML 6.00.2800.1479" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY text=#000000 bgColor=#ffffff> <DIV><FONT face=Arial>Try the following in httpd.conf</FONT></DIV> <DIV><FONT face=Arial></FONT> </DIV> <DIV><FONT face=Arial><Directory "full/path/to/your/base/directory/imageview5/view/*"> </FONT></DIV> <DIV><FONT face=Arial> ReWriteEngine on</FONT></DIV> <DIV><FONT face=Arial> ReWriteCond %{SERVER_PORT} ^80$</FONT></DIV> <DIV><FONT face=Arial> ReWriteRule ^/($) <A class=moz-txt-link-freetext href="http://schrauwen.no-ip.org/imageview5/index.php?album=$1&file=$2" >http://schrauwen.no-ip.org/imageview5/index.php?album=$1&file=$2</A> [R]</FONT></DIV> <DIV><FONT face=Arial></Directory></FONT></DIV> <DIV><FONT face=Arial></FONT> </DIV> <DIV><FONT face=Arial>This rule should take any port 80 request to anything contained in ../imageview/view/ and redirect it to the specified path. With obvious differences, this is what I use to redirect all requests to all folders and files in a specific directory to a different address. I may be mistaken but I think that the ReWriteCond condition is required. Also make sure that the LoadModule and AddModule entries for rewrite are uncommented.</FONT></DIV> <DIV><FONT face=Arial></FONT> </DIV> <DIV><FONT face=Arial>Hope this helps.</FONT></DIV> <DIV><FONT face=Arial></FONT> </DIV> <DIV><FONT face=Arial>JM</FONT></DIV> <BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV> <DIV style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> <A title=jorge@(protected) href="mailto:jorge@(protected)">Jorge Schrauwen</A > </DIV> <DIV style="FONT: 10pt arial"><B>To:</B> <A title=users@(protected) href="mailto:users@(protected)">users@(protected)</A> </DIV> <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, January 20, 2005 11:25 AM</DIV> <DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [users@(protected)] Mod_rewrite help</DIV> <DIV><BR></DIV> <DIV dir=ltr align=left><SPAN class=507512416-20012005><FONT face=Arial color=#0000ff size=2>yes, i always get errors!</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=507512416-20012005><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV dir=ltr align=left><SPAN class=507512416-20012005><FONT face=Arial color=#0000ff size=2>and how would i turn on the loggin for mod_rewrite? i don't have it on.</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=507512416-20012005><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV dir=ltr align=left><SPAN class=507512416-20012005><FONT face=Arial color=#0000ff size=2>Jorge</FONT></SPAN></DIV><BR> <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left> <HR tabIndex=-1> <FONT face=Tahoma size=2><B>From:</B> Sean T Allen [mailto:sean@(protected)] <BR><B>Sent:</B> Thursday, January 20, 2005 17:05<BR><B>To:</B> <A href="mailto:users@(protected)">users@(protected)</A><BR><B>Subject :</B> Re: [users@(protected)] Mod_rewrite help<BR></FONT><BR></DIV> <DIV></DIV>Are you getting the error all the time or only when going through a vhost...<BR><BR>Have you turned on mod rewrite logging to get a better idea of what is going on?<BR><BR>Jorge Schrauwen wrote: <BLOCKQUOTE cite=mid200501201540.j0KFeMl7018151@(protected) type="cite"> <META content="MSHTML 6.00.2900.2523" name=GENERATOR> <DIV dir=ltr align=left><SPAN class=823573915-20012005><FONT face=Arial color=#0000ff size=2>Yes,</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=823573915-20012005><FONT face=Arial color=#0000ff size=2>Main config -> http</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=823573915-20012005><FONT face=Arial color=#0000ff size=2>vhost -> https</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=823573915-20012005><FONT face=Arial color=#0000ff size=2>vhost2 -> DAV</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=823573915-20012005></SPAN> </DIV> <DIV dir=ltr align=left><SPAN class=823573915-20012005><FONT face=Arial color=#0000ff size=2>Jorge</FONT></SPAN></DIV> <DIV dir=ltr align=left> <HR tabIndex=-1> </DIV> <DIV dir=ltr align=left><FONT face=Tahoma size=2><B>From:</B> Sean T Allen [<A class=moz-txt-link-freetext href="mailto:sean@(protected)">mailto:sean@(protected)</A>] <BR><B>Sent:</B > Thursday, January 20, 2005 16:33<BR><B>To:</B> <A class=moz-txt-link-abbreviated href="mailto:users@(protected)">users@(protected)</A><BR><B >Subject:</B> Re: [users@(protected)] Mod_rewrite help<BR></FONT><BR></DIV>Then it probably is an issue somewhere else in your configuration...<BR><BR>Are you using virtual hosting?<BR><BR>Jorge Schrauwen wrote: <BLOCKQUOTE cite=mid200501201453.j0KEr18q022173@(protected) type="cite"> <META content="MSHTML 6.00.2900.2523" name=GENERATOR> <DIV dir=ltr align=left><SPAN class=053545214-20012005><FONT face=Arial color=#0000ff size=2>nope adding the [R,L] didn't help :(</FONT></SPAN></DIV> <DIV dir=ltr align=left><SPAN class=053545214-20012005></SPAN> </DIV> <DIV dir=ltr align=left><SPAN class=053545214-20012005><FONT face=Arial color=#0000ff size=2>Jorge</FONT></SPAN></DIV><BR> <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left> <HR tabIndex=-1> <FONT face=Tahoma size=2><B>From:</B> Sean T Allen [<A class=moz-txt-link-freetext href="mailto:sean@(protected)">mailto:sean@(protected)</A>] <BR><B>Sent:</B> Wednesday, January 19, 2005 22:48<BR><B>To:</B> <A class=moz-txt-link-abbreviated href="mailto:users@(protected)">users@(protected)</A><BR><B >Subject:</B> Re: [users@(protected)] Mod_rewrite help<BR></FONT><BR></DIV><PRE wrap="" >RewriteEngine on RewriteRule ^/imageview5/view/(.*)/(.*) <A class=moz-txt-link-freetext href= "http://schrauwen.no-ip.org/imageview5/index.php?album=$1&file=$2">http:/ /schrauwen.no-ip.org/imageview5/index.php?album=$1&file=$2</A> [R,L]
</PRE><BR>Jorge Schrauwen wrote: <BLOCKQUOTE cite=mid200501192104.j0JL4TKx019187@(protected) type="cite"><PRE wrap="">Ok now I have: --- RewriteEngine on RewriteRule ^/imageview5/view/(.*)/(.*) <A class=moz-txt-link-freetext href="http://schrauwen.no-ip.org/imageview5 /index.php?album=$1&file=$2">http://schrauwen.no-ip.org/imageview5/index.php ?album=$1&file=$2</A> --- And it olso doesn't work, error log line is still the same.
Thanx again for the help
Jorg
-----Original Message----- From: Brian V Hughes [<A class=moz-txt-link-freetext href="mailto:brianvh @(protected)">mailto:brianvh@(protected)</A>] Sent: Wednesday, January 19, 2005 20:40 To: <A class=moz-txt-link-abbreviated href="mailto:users@(protected)" >users@(protected)</A> Subject: Re: [users@(protected)] Mod_rewrite help
Have you tried putting in a line to turn on Rewrite logging? That way you can look through the log file to see exactly what mod_rewrite is doing to the request URLs.
-Brian
On Jan 19, 2005, at 02:37 PM, Jorge Schrauwen wrote: </PRE> <BLOCKQUOTE type="cite"><PRE wrap="">No, still doesnt work, i still get a 404. I tried from .htaccess and httpd.conf, same result --- error.log --- [Wed Jan 19 20:34:10 2005] [error] [client 192.168.2.4] File does not exist: S:/wwwroot/imageview5/view thanx for the help though Jorge </PRE></BLOCKQUOTE><PRE wrap=""><!---->
--------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <A class=moz-txt-link-rfc1738 href="http://httpd.apache.org/userslist.html" ><URL:http://httpd.apache.org/userslist.html></A> for more info. To unsubscribe, e-mail: <A class=moz-txt-link-abbreviated href="mailto:users -unsubscribe@(protected)">users-unsubscribe@(protected)</A> " from the digest: <A class=moz-txt-link-abbreviated href="mailto:users -digest-unsubscribe@(protected)">users-digest-unsubscribe@(protected)< /A> For additional commands, e-mail: <A class=moz-txt-link-abbreviated href="mailto :users-help@(protected)">users-help@(protected)</A>
--------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <A class=moz-txt-link-rfc1738 href="http://httpd.apache.org/userslist.html" ><URL:http://httpd.apache.org/userslist.html></A> for more info. To unsubscribe, e-mail: <A class=moz-txt-link-abbreviated href="mailto:users -unsubscribe@(protected)">users-unsubscribe@(protected)</A> " from the digest: <A class=moz-txt-link-abbreviated href="mailto:users -digest-unsubscribe@(protected)">users-digest-unsubscribe@(protected)< /A> For additional commands, e-mail: <A class=moz-txt-link-abbreviated href="mailto :users-help@(protected)">users-help@(protected)</A>
</PRE></BLOCKQUOTE><BR></BLOCKQUOTE><BR></BLOCKQUOTE><BR></BLOCKQUOTE></BODY> </HTML>
|
|
 |