LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mod_rewrite question (https://www.linuxquestions.org/questions/linux-newbie-8/mod_rewrite-question-150589/)

hct224 02-25-2004 10:16 PM

Mod_rewrite question
 
Hi all,
I load mod_rewrite on the httpd.conf file. Now, how do I test to see if it work correctly?

Thanks

Capt_Caveman 02-25-2004 10:55 PM

Put in a rewrite rule in the httpd.conf file:

RewriteEngine on
ReWriteCond condition to match here
ReWriteRule what you wanna do here

ciscohead 02-22-2006 10:11 PM

where would be the right place?
 
I've always done Rewrite rules inside virtuls. but this box doesn't have (or need) any. so where do I put the rewrite rules? thanks.

gilead 02-22-2006 10:22 PM

One of the examples in the docs at http://httpd.apache.org/docs/2.0/misc/rewriteguide.html has the following (I've removed the comments):
Code:

UseCanonicalName on
CustomLog  /path/to/access_log  "%{VHOST}e %h %l %u %t \"%r\" %>s %b"
RewriteEngine on
RewriteMap    lowercase    int:tolower
RewriteMap    vhost        txt:/path/to/vhost.map
RewriteCond  %{REQUEST_URI}  !^/commonurl1/.*

In other words, in Section 2 of httpd.conf - the 'Main' server configuration.

silmaril8n 02-23-2006 12:28 AM

You can also throw them into an .htaccess file for easier editing access than in httpd.conf

ciscohead 02-23-2006 11:03 AM

Thanks
 
I threw it into the <directory> it accepted the actual Rewrite rules and Rewrite on, but I had some rewrite log configurations and log level and it said they can't be there. and needless to say it did nt work.

I've always been told that putting it in the server conf is way more efficient, and also that .htaccess files are more error prone but I'm totally OK with using .htaccess on the dev box. For me it is much of a muchness. I own the colo server where there are virtuals, and the dev box where there arent.


All times are GMT -5. The time now is 09:52 PM.