NameSilo

.htaccess help

Spaceship Spaceship
Watch

WittyCyberDesigners

Account Closed
Impact
0
I USE MULTIUSER forum SCRIPT

and the blogs are displayed as


sitename/forums/forumusername/index.php

anyone who can merge it to
forumusername.sitename/index.php


wildcard domain is not a problem

but this htaccess is :(
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
I think something along the lines of:

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.*)\.sitename.com$
RewriteRule ^(.*)$ http://sitename.com/%1/$1 [P,L]

You'll need to setup your wildcarded subdomains, then put the above into the .htaccess file in the webroot of your wildcarded subdomains.

the first line swicthes mod_rewrite on. The second line captures the forumusername from the HTTP_HOST header. The last line rewrites the URL. The %1 is replaced with the forumusername captured on line 2. The $1 is replaced by the URL matched by line 3.

The P flag on the last line enables proxying of the rewrite. This means that the visitor sees the original URL in their address bar, not the rewritten one. You'll need mod_proxy installed on the server for this to work. You can remove the P flag if you wish.
 
0
•••
thanks for this


will try it
 
0
•••
try this as well :)

sitename/forums/forumusername/index.php

anyone who can merge it to
forumusername.sitename/index.php

Code:
RewriteEngine on
Options +FollowSymlinks
RewriteCond %{HTTP_HOST} ^sitename/forums/forumusername/$ [NC]
RewriteRule ^(.*) http://forumusername.sitename/$1 [L]
 
0
•••
try this as well :)

sitename/forums/forumusername/index.php

anyone who can merge it to
forumusername.sitename/index.php

Code:
RewriteEngine on
Options +FollowSymlinks
RewriteCond %{HTTP_HOST} ^sitename/forums/forumusername/$ [NC]
RewriteRule ^(.*) http://forumusername.sitename/$1 [L]



i guess it will do for only one forumusername

where as i want it for all of them
 
0
•••
Wildcard subdomains are incredibly hard to do. Virtually impossible with third-party code.

The only way you will ever make this work is if you build your own code from the ground up. And when I say from the ground up, I mean starting with the httpd.conf file in Apache (that's where the wildcard has to be configured, I've never gotten it to work in htaccess).

It's a big time trick to pull off. I've only ever done it in a non-production environment.
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer

We're social

Domain Recover
DomainEasy — Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back