How to edit this .htaccess

Discussion in 'Programming' started by fluor, Jun 28, 2010.

  1. #1
    I use Mihalism Multi Forum Host.

    It creates forums now like: Mydomain.com/forum/<user_name>

    I want to create like: <user_name>.mydomain/forum

    How to edit? Now it`s:
    RewriteEngine On
    RewriteBase /
    RewriteRule ^forums$|^forums/$ index.php [R=301,L]
    RewriteRule ^forums/([-_a-zA-Z0-9]{3,30})$ forums/$1/ [R=301,L]
    RewriteRule ^forums/([-_a-zA-Z0-9]{3,30})/(.*)$ phpBB3/$2?access_name=$1 [QSA,L]
    Code (markup):
    access_name it`s username here:)

    Thanks for future help!!!

    Regards,
    Fluor
     
    fluor, Jun 28, 2010 IP
  2. spyka

    spyka Greenhorn

    Messages:
    90
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    You'll probably need to add a new wildcard DNS record.

    Then you'll need to setup a server alias - If you're on apache add *.domain.com as the ServerAlias

    the HTaccess:

    RewriteCond %{HTTP_HOST} !www.yourdomain.com$ [NC]
    RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-]+).yourdomain.com [NC]
    RewriteRule (.*) phpBB3/$1?access_name=%2 [NC,QSA]
     
    spyka, Jun 28, 2010 IP
  3. fluor

    fluor Active Member

    Messages:
    571
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #3
    Right, One more question:) > can i`ve two different htaccess files on root? I`ve 2 scripts that are combined and both require specific htaccess configuration, or how to bring them togheter?

    Thx for support!

    Regards,
     
    fluor, Jun 29, 2010 IP
  4. newcity

    newcity Peon

    Messages:
    1,015
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I don't think 2 htaccess files are possible. They might conflict each other. Besides its supposed to be just one htaccess for a folder.
     
    newcity, Jul 3, 2010 IP