Results 1 to 2 of 2

Thread: Rewrite for subdomain

  1. #1
    Join Date
    Mar 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Rewrite for subdomain

    Having a bit of a hard time to come up with a way to do this.

    The rewrite works, but instead of outputting http://www.domain.com/page.php?val=something I want it to display http://something.domain.com only. And, I also want it to only apply to page.php when val is set (if possible) and links on that page should be http://www.domain.com/tralala (if possible).

    I'm right now using:
    RewriteCond %{HTTP_HOST} !^www.* [NC]
    RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com
    RewriteRule ^(.*)$ http://www.domain.com/page.php?val=%1 [L]
    Thankful for any help you can give me!

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Have a look at B&T's Tips and Scripts

    Great resource site for a lot of little site tweaks too
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

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