Find the answer to your Linux question:
Results 1 to 3 of 3
Hello, Need some help rewriting from one subdomain to another that takes in account potentially old bookmarks from the old subdomain. I have a basic redirect like: RewriteCond %{HTTP_HOST} ^oldsub.domain\.com$ ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! jamsda's Avatar
    Join Date
    May 2006
    Posts
    5

    [SOLVED] mod rewrite question


    Hello,

    Need some help rewriting from one subdomain to another that takes in account potentially old bookmarks from the old subdomain. I have a basic redirect like:

    RewriteCond %{HTTP_HOST} ^oldsub.domain\.com$ [NC]
    RewriteRule ^/(.*)$ http://newsub.domain\.com/$1 [R=301,L]

    Which works fine. But on the RewriteCond I'm trying to figure out a wildcard for users that may have bookmarked eg (oldsub.domain.com/forum/something.php?do=thread). So everything to the right of oldsub.domain.com/ erased, and redirected to the newsub.domain.com

    Any ideas? Would be much appreciated..

    Thanks,
    Jim

  2. #2
    Just Joined!
    Join Date
    Oct 2008
    Posts
    21
    it could be
    RewriteCond %{SERVER_NAME} !^newsub\.domain\.com$
    RewriteRule --your rule

  3. #3
    Just Joined! jamsda's Avatar
    Join Date
    May 2006
    Posts
    5
    Thanks for the reply, I got it done with this:

    RewriteCond %{HTTP_HOST} ^oldsub.domain.com(.*)$ [NC]
    RewriteRule ^/(.*)$ http://newsub.domain.com/ [R,L]

    Jim

  4. $spacer_open
    $spacer_close

Posting Permissions

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