LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-26-2010, 05:57 AM   #1
mahmoud
Member
 
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269

Rep: Reputation: 30
Post Apache rewrite map to text file


Hi,
i am trying to get this rewrite using a text file to work but it seems not to pick up the text or read it the way i want.
here is what is happening i want to merge 2 domains .com and .net into one vhost file and one website. but the .net has alot of redirects which i want to put in a txt file bacuse there are over 200 line of redirects static.also exclude the robots.txt file. and i want the rule to look for any string be it after the first slash of with the url like so

www.site.net/wsd/html/aboutus.html
or
www.site.net/bbb/wsd/html/aboutus.html

should use the map text file and rewrite.

txt file example
wsd/html/aboutus.html /aboutus
wsd/html/aboutus.htm /aboutus
wsd/html/aboutus.php /aboutus

RewriteMap links txt:/var/www/bin/rewritemap1.txt
RewriteCond $1 !robot.txt$
RewriteRule ^/(.*) ${links:$1|http://www.site.com/} [R=301,L]

i have googled and tried so many regex none seem to work.
thanks
 
Old 02-27-2010, 04:02 AM   #2
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 703

Rep: Reputation: 99
I don't see anything wrong with your example. Can you see if there
are any entries in your apache error log file?
 
  


Reply



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
Apache Rewrite mahmoud Linux - Software 2 11-11-2008 07:52 AM
apache mod_fastcgi: .fcgi file returning as text. Llanilek Linux - Software 0 10-25-2008 10:05 AM
How to parse text file to a set text column width and output to new text file? jsstevenson Programming 12 04-23-2008 02:36 PM
Apache 1.3 - .php file ain't parsed, only text misstajah Linux - Server 4 09-21-2006 06:14 AM
SYSERR(root): hash map "generics": missing map file /etc/mail/genericstable.db? singying304 Linux - Networking 4 02-28-2005 06:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:25 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration