FreePgs.com Forum

FreePgs Related => Support Requests => Topic started by: Dondavid on December 19, 2005, 12:49:15 PM

Title: subdomains with .htaccess
Post by: Dondavid on December 19, 2005, 12:49:15 PM
Hi, I don't  fully know how I could explain my problem 'cause my English sucks...

I registered a domain: www.creersonsite.fr.nf and a subdomain: forum.creersonsite.fr.nf

I'd like the user to be redirected to www.creersonsite.fr.nf/Forum/ while visiting forum.creersonsite.fr.nf
but I don't want the redirected url to be written in the address bar. I think I must use a .htaccess file.
But I don't know how.
I mean I thought I only had to write this:

RewriteCond  %{HTTP_HOST}  forum.creersonsite.fr.nf
RewriteRule  ^ Forum/{REQUEST_URI}  [L]

But this is not working. Is there anyone who could help me please?
Title: Re: subdomains with .htaccess
Post by: webzone (archived) on December 19, 2005, 10:36:35 PM
You could try this code. I use a very similar one on my site. Or you could just use the solution that the admin offers below.

In /.htaccess

RewriteEngine On
RewriteCond %{HTTP_HOST} ^forum.creersonsite.fr.nf$
RewriteRule ^(.*)$ Forum/$1 [L]


In the subdirectory (in your case, /Forum/.htaccess)

RewriteEngine On
RewriteCond %{HTTP_HOST} !^forum.creersonsite.fr.nf$
RewriteRule ^(Forum/)?(.*)$ http://forum.creersonsite.fr.nf/$2 [L,R=permanent]


This code will map the "forum" subdomain to the Forum subdirectory. It will also redirect visitors from www.creersonsite.fr.nf/Forum/ to forum.creersonsite.fr.nf.

There is more info available about building mod_rewrite instructions on the Apache website (http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html).
Title: Re: subdomains with .htaccess
Post by: admin on December 20, 2005, 03:37:54 AM
Please request your subdomains via the Contact Form.

We can directly map these to the directories you specify.  When you added these subdomains the directories were empty so they were not pointed.

In the contact request, please include the subdomain name and the directory you wish to have the subdomain pointed to.

Thank you,
FreePgs.com Admin
Title: Re: subdomains with .htaccess
Post by: webzone (archived) on December 20, 2005, 03:48:10 AM
QuoteWe can directly map these to the directories you specify.  When you added these subdomains the directories were empty so they were not pointed.

Oops! I had forgotten that it was so simple (at least from a users' point of view) when I replied. Looking too far for the solution isn't a good idea obviously.
Title: Re: subdomains with .htaccess
Post by: Dondavid on December 20, 2005, 06:33:45 PM
Ok Thanks you very much indeed for your replies.