Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2007
    Posts
    193

    Rewrite Rule Help

    I want all requests to this domain
    http://www.xyz.com/files/1/.....

    to

    http://www.abc.com/files/1/....

    RewriteCond %{HTTP_HOST} ^xyz\.com [nc]
    RewriteRule ^xyz.com/files/1/$ http://www.abc.com/files/$1 [R=301,nc]

    But this isnt working.. Kindly suggestion to correct code..

  2. #2
    Join Date
    Aug 2009
    Posts
    476
    Did you also add this line:

    RewriteEngine On

    ?

  3. #3
    Try this.

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.xyz.com$ [NC]
    RewriteRule ^(.*)$ http://www.abc.com/$1 [R=301,L]
    Last edited by adminpaul; 09-17-2009 at 09:00 AM. Reason: error

  4. #4
    Join Date
    Aug 2007
    Posts
    193
    well i want that if it goes in folder /files/1/ then only it gets redirected so the code should be

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.xyz.com/files/1/$ [NC]
    RewriteRule ^(.*)$ http://www.abc.com/files/1/$1 [R=301,L]

    Right??

Similar Threads

  1. help with a rewrite rule
    By HD Fanatic in forum Hosting Security and Technology
    Replies: 3
    Last Post: 04-15-2008, 07:44 AM
  2. Rewrite rule Help
    By mali in forum Hosting Security and Technology
    Replies: 3
    Last Post: 09-18-2007, 03:12 AM
  3. rewrite rule
    By cybersavvy in forum Hosting Security and Technology
    Replies: 1
    Last Post: 07-09-2007, 04:20 PM
  4. mod rewrite rule help
    By Datacenter1 in forum Hosting Security and Technology
    Replies: 3
    Last Post: 02-18-2007, 04:29 AM
  5. rewrite rule
    By Bambuk in forum Programming Discussion
    Replies: 2
    Last Post: 09-13-2005, 04:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •