The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > Web Programming, Web 2.0 and Mashups
.
google unix.com



Web Programming, Web 2.0 and Mashups Discuss Web Programming and Web Server Administration, including LAMP, Apache, MySQL, Flash, HTML, SEO, Mashups and other Web APIs and topics.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Rewrite rules to change “link.html?hl=es” to “/es/link.html” etc? Neo Web Programming, Web 2.0 and Mashups 2 08-07-2009 01:14 PM
Business Rules Forum 2008: Upper Ontology for Events, Processes, States, Rules iBot Complex Event Processing RSS News 0 10-30-2008 10:00 AM
APACHE rewrite / redirect URL ampo Web Programming, Web 2.0 and Mashups 2 10-27-2008 10:25 AM
APACHE rewrite / redirect URL ampo Security 1 10-13-2008 04:27 AM
Apache Rewrite help! hassan2 UNIX for Advanced & Expert Users 1 11-11-2002 01:35 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-01-2009
sambadamerla sambadamerla is offline
Registered User
  
 

Join Date: Oct 2009
Posts: 2
Apache rewrite rules.

Hi,
I am new to Apache but I have requirement as follows.
if the url is http://images/data1/templates/[rest of the url path] it should redirect to http:/172.20.224.23/templates/[rest of the url path]
if the url doesn't have "data1/templates" (mean http://images/[anyuri]) it should redirect to http://images:8080/[rest of the url path].

I tried as below
Code:
RewriteCond %{REQUEST_URI} ^/dm5/Templates/.*
RewriteRule ^/dm5/Templates/(.*) http://172.20.224.23:80/templates/$1 [L]
 RewriteRule ^/(.*) http://images:8080/$1 [L]
It is all the time redirecting to http://images:8080/[rest of the url path].

If i comment out "RewriteRule ^/(.*) http://images:8080/$1 [L] " then i am getting the error "File does not exist: " in htdocs folder.

Please help me how to achieve my requirement.

Thanks
Samba Damerla
  #2 (permalink)  
Old 10-01-2009
Neo's Avatar
Neo Neo is online now Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,670
Where exactly is your rewrite rule?
  #3 (permalink)  
Old 10-01-2009
sambadamerla sambadamerla is offline
Registered User
  
 

Join Date: Oct 2009
Posts: 2
May be i didn't understood your question. The below are my rewrite rule i write this in Virtula_host section.

RewriteCond %{REQUEST_URI} ^/dm5/Templates/.*
RewriteRule ^/dm5/Templates/(.*) http://172.20.224.23:80/templates/$1 [L]
RewriteRule ^/(.*) http://images:8080/$1 [L]
  #4 (permalink)  
Old 10-02-2009
Neo's Avatar
Neo Neo is online now Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,670
For this type of rewrite rules, I recommend you place it in the .htaccess file in the appropriate directory or directories and not in your virtual host configuration.
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:49 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0