• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Apache redirects

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have written the redirect rule something like this in httpd.conf file

RewriteRule ^/internetadvertising(.*)$ http://marketing.abc.com/products/abc-online/ [R=301,L,NE]


The issue I am facing is whenever i hit the any of the source URL mentioned below, its going to http://marketing.abc.com/products/abc-online/ that is second Destination URL.

I am facing difficult to make apache to understand to differenciate the below two source URL so that it can land up in respective destination URL.



1)Source URL-->https://yelldirect.com/internetadvertising/searchmarketingservices/ Destination URL-->http://marketing.yell.com/products/search-marketing-services/

and

2)Source URL -->https://xyz.com/internetadvertising/payperclick/ Destination URL-->http://marketing.abc.com/products/abc-online/






 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Put something like

RewriteCond %{HTTP_HOST} ^xyz\.com$

or

RewriteCond %{HTTP_HOST} ^yelldirect\.com$

before each RewriteRule, repectively.
 
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic