Advanced Search

Results 1 to 4 of 4

Thread: .htaccess rewrite url problem

  1. #1
    Join Date
    Aug 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default .htaccess rewrite url problem

    I try to create a virtual subdomain by rewriting url in .htaccess
    below is the code

    <IfModule mod_rewrite.c>
    Options +FollowSymLinks
    Options +Indexes
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !www.mydomain.co.id$ [NC]
    RewriteCond %{HTTP_HOST} ^([a-z0-9-]+).mydomain.co.id [NC]
    RewriteRule (.*) page.php?username=%1 [L]
    </IfModule>
    ErrorDocument 404 /page_error.html

    the problem is that when i try this www.aaaaa.mydomain.co.id , i will then redirected to default web page cgi-sys... but once i try aaaaaa.mydomain.co.id then i will have this SERVER NOT FOUND

    i really dont have anymore idea on how to solve this problem, hope that anyone could come up with a solution

    thx in advance

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,624
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    never tried it, but have you tried first rewriting all non-www urls with the www? So, in effect, if I typed sub.example.com, it would redirect to www.sub.example.com and then to the user page?
    We Only Torture the Folks We Don't Like (You're Probably Gonna Be Okay)
    It's a Party in the CIA

  3. #3
    Join Date
    Aug 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    nope cause i dont have any idea on how to do it

    i am new to .htaccess, could you point me out??

  4. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,624
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    I know a good htaccess tutorial - let me find it, and I'll try out some rules too.
    We Only Torture the Folks We Don't Like (You're Probably Gonna Be Okay)
    It's a Party in the CIA

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
  •