.htaccess mod_rewrite, subdomain to specific subdir

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • piku
    Senior Member
    • Mar 2004
    • 153

    #1

    .htaccess mod_rewrite, subdomain to specific subdir

    i'd like to do the following,

    http://user1.mydomain.com >> /_users/user1

    instead of using cpanel's default subdomain (ie. /user1)

    i have the following code ...

    Code:
    RewriteEngine On
    Options +FollowSymlinks
    RewriteCond %{HTTP_HOST} user1.mydomain.com
    RewriteCond %{REQUEST_URI} !_users/
    RewriteRule ^(.*)$ _users/user1/$1 [L]
    but i dont think its correct...any help would be greatly appreciated. TIA

    ps. FYI, i have a static IP along w/ the cp account
    my signature was deleted. i miss my signature-filled-with-helpful-dathorn-links *sniff*sniff*
  • Extremeality
    Junior Member
    • Mar 2004
    • 6

    #2
    Don't know if this will help but this mod rewrite will redirect your domain and all subdirectories to a subdomain of the same domain.

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^(.*)home\.yourdomain\.com$ [NC]
    RewriteRule ^.*$ http://home.yourdomain.com [R]

    You might can take part of this code and make it work for what you're trying to do. I put this code together by searching at Sitepoints.com forum.

    I hope this helps.

    Dave

    Comment

    • piku
      Senior Member
      • Mar 2004
      • 153

      #3
      the above is for redirection, while mine...actually acts like cpanels--i guess it works. i just forgot the the default templates on MT needed to be changed. i was using MT2.661 and forgot to grab the newest default templates, which were needed to work w/ the current default styles on their site.

      thanks anyways. but both codes should provide other people the help they need in the future.
      my signature was deleted. i miss my signature-filled-with-helpful-dathorn-links *sniff*sniff*

      Comment

      Working...