Forum Moderators: phranque

Message Too Old, No Replies

Multiple Redirections

         

jamesko20

6:58 pm on Sep 2, 2004 (gmt 0)

10+ Year Member



Hello everyone,
I run a free forum hosting service, currently my members acces their board using the following url :

Quote:
[f.mysite.com...]

I would like them to be able to acces their board through the following urls :

Quote:
[mysite.com...]
[mysite.com...]
[yourforumname.mysite.com...]

Could someone please give me the correct rewrite rules to achieve this?
I do not have root acces on the server and therefore can only use the .htacces
Thanks in advance for your help,
James

jdMorgan

7:31 pm on Sep 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jamesko,

Welcome to WebmasterWorld!

We're not set up to write your code, but rather to help you get your code working. See our charter [webmasterworld.com] for more information and references.

This thread, on rewriting arbitrary subdomains to subdirectories [webmasterworld.com], contains some code you can modify to fit your third rewrite. Your first two rewrites are much simpler than that one.

Jim

jamesko20

1:52 pm on Sep 3, 2004 (gmt 0)

10+ Year Member



Hello,
I have looked around on the forums and found quite a few threads with 'solutions' but it appears none work, I was told I should have 'wildcard dns' enabled, i would like to know who i need to contact to enable this, my registrar or my host?
Thanks for your help,

jamesko20

12:08 pm on Sep 4, 2004 (gmt 0)

10+ Year Member



Anyone?

jdMorgan

2:49 pm on Sep 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ask your host where to find your "DNS zone file."

In it, you will find lines like this:

mydomain.com. IN A 192.168.0.123
www.mydomain.com. IN A 192.168.0.123

Which you can change to read:
mydomain.com. IN A 192.168.0.123
www.mydomain.com. IN A 192.168.0.123
*.mydomain.com. IN A 192.168.0.123

The period following the domain name is required. You don't technically need the second line shown above in the new zone file, but leave it in, just in case you change your mind and want to remove the wild-card line after experimenting with it.

After making a change, it can take up to 48 hours before the new configuration is propagated to DNS servers world-wide.

Your server will also need to be set up to accept the wild-card subdomains. Again, ask your host.

Jim

jamesko20

3:15 pm on Sep 8, 2004 (gmt 0)

10+ Year Member



Jdmorgan,
Thanks for your help, my host said we will do that next week :)

I just worked out the following rule for redirecting ***.htm to /f/?forum=*** and it works fine :
RewriteRule ^(.*)?/index.htm(l)?$ http://www.example.com/f/?forum=$1 [L,NC,NS]
RewriteRule ^(.*)?\.htm(l)?$ http://www.example.com/f/?forum=$1 [L,NC,NS]

Any idea how I could make /***/ redirect to /f/?forum=***?

I would also like to redirect [mysite.com...] to [mysite.com...] (this whateever comes after the myforum eg variables like :&showforum=1)
If someone could point me into the right direction ...
Thanks in advance for your help,
James

[edited by: jdMorgan at 3:29 pm (utc) on Sep. 8, 2004]
[edit reason] Removed specifics per TOS [/edit]

jamesko20

7:38 pm on Sep 9, 2004 (gmt 0)

10+ Year Member



Anyone?

jdMorgan

2:50 am on Sep 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jamesko20,

Check your stickymail (link at top of screen). Our charter contains links to useful resources, as well as the policies of this forum. We'll be happy to help you get your code working.

Jim