LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-25-2004, 10:16 PM   #1
hct224
Member
 
Registered: Jun 2003
Distribution: Redhat
Posts: 87

Rep: Reputation: 15
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
 
Old 02-25-2004, 10:55 PM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 57
Put in a rewrite rule in the httpd.conf file:

RewriteEngine on
ReWriteCond condition to match here
ReWriteRule what you wanna do here
 
Old 02-22-2006, 10:11 PM   #3
ciscohead
Member
 
Registered: Mar 2003
Distribution: redhad 7.3
Posts: 42

Rep: Reputation: 15
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.
 
Old 02-22-2006, 10:22 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 162Reputation: 162
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.
 
Old 02-23-2006, 12:28 AM   #5
silmaril8n
Member
 
Registered: May 2004
Location: Vancouver, WA
Distribution: Mint, Debian, Slackware
Posts: 123

Rep: Reputation: 15
You can also throw them into an .htaccess file for easier editing access than in httpd.conf
 
Old 02-23-2006, 11:03 AM   #6
ciscohead
Member
 
Registered: Mar 2003
Distribution: redhad 7.3
Posts: 42

Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mod_rewrite problem jfall Programming 1 02-22-2005 07:05 PM
mod_rewrite to allow only 127.0.0.1? jimieee Linux - Security 2 06-08-2004 04:17 AM
Mod_Rewrite help in Apace 1.3... vrillusions Linux - Software 0 08-11-2003 09:18 PM
Apache (mod_rewrite) question Wonko the Sane Linux - Software 1 06-15-2003 12:55 PM
Enableing MOD_REWRITE prtynked General 0 04-01-2002 05:18 PM


All times are GMT -5. The time now is 04:43 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration