Newbie question.

New to mod_rewrite? This is a good place to start.

Newbie question.

Postby yeago » Tue Jan 10, 2006 12:54 am

http://corz.org/serv/tricks/htaccess2.php

Found above tutorial on mod_rewrite.

Attempting to use this example Fails (404):
Code: Select all
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^files/(.+)/(.+).zip download.php?section=$1&file=$2 [nc]


HOWEVER, if I do this:

Code: Select all
RewriteRule ^(.*)files/(.+)/(.+).zip http://$1/download.php?section=$2&file=$3 [nc]


Works ok EXCEPT the url BECOMES wtvr.com/download.php?section=yadda&file=badda

I thought the point of the above script was simply to excute download.php in the BACKGROUND, not forward the user to a new URL. So I can't help but feel like my example is what is causing the problem

I attempted to put RewriteLog "some.log" in my .httaccess file but I got sitewide 500 error. As yet I do not have access to my Apache logs.

What's weird is another example worked fine:

Code: Select all
Options +FollowSymlinks
rewriteengine on
rewriterule ^(.+)\.htm$ http://corz.org/$1.php [r=301,nc]


Yet the first example fails (404):

Code: Select all
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.htm $1.php [nc]


At the end of the day I just want users to be able to navigate my sites like

http://mysite.com/search/blah

instead of seeing http://www.mysite.com/do_search.php?terms=blah

and see these style urls consistently. I get the gist of it but something is obvioulsy misset on my server. I have an email into host to get access to the raw apache error logs, but can someone see what is happening wrong?

Also, what is with the 500 error on RewriteLogs. This is, from what I can tell, an internet mystery (Plenty of people have had the problem, no answers that I've found).

-s
yeago
 
Posts: 3
Joined: Tue Jan 10, 2006 12:43 am

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 7 guests

cron