Rusnak PHP Scripts Support Forums

Full Version: shorter domains
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hey guys, i was that desperate for a shorter domains mod that im trying to do it myself, i am editing the mkconfig.php and adding a new line to the .htaccess but i am having a problem

i keep getting a 500 error because its not putting a break between your code and my code i added
Code:
//Start Writing
    $write1 = "\nRewriteCond %{SCRIPT_FILENAME} !-f\n";
    fwrite($fh, $write1);
    $write2 = "RewriteCond %{SCRIPT_FILENAME} !-d\n";
    fwrite($fh, $write2);
    $write3 = 'RewriteRule ^'.$spath.'/'.$go.'/(.+)$ /'.$spath.'/$1 [QSA,L]';
    fwrite($fh, $write3);
    $write4 = "\nRedirect 301 /".$spath."/".$go."/index.htm http://www.".$dname."/".$spath."/".$go."/index.php";
    fwrite($fh, $write4);
      $write5="Redirect /$fname http://www.icorforum.co.cc/mybb/$fname"
fwrite($fh, $write5);
    fclose($fh); //Close the file

how would i place a break between them?
i fixed it
now when a new forum is made it adds extra line to the .htaccess so the forum can be accessed via a redirect from the main domain

to do this to your forum open mkforum.php and find
Code:
//Now that all of that is out of the way, let's write the .htaccess file

    $go = $fname; //The name of our forum, this is important

    //Open file for writing
    $ourFileName = '../../.htaccess';
    $fh = fopen($ourFileName, 'a') or die("Can't open file to write forum alias");

    //Start Writing
    $write1 = "\nRewriteCond %{SCRIPT_FILENAME} !-f\n";
    fwrite($fh, $write1);
    $write2 = "RewriteCond %{SCRIPT_FILENAME} !-d\n";
    fwrite($fh, $write2);
    $write3 = 'RewriteRule ^'.$spath.'/'.$go.'/(.+)$ /'.$spath.'/$1 [QSA,L]';
    fwrite($fh, $write3);
    $write4 = "\nRedirect 301 /".$spath."/".$go."/index.htm http://www.".$dname."/".$spath."/".$go."/index.php";
    fwrite($fh, $write4);
    fclose($fh); //Close the file

//echo '<br>Done!';

replace with
Code:
//Now that all of that is out of the way, let's write the .htaccess file

    $go = $fname; //The name of our forum, this is important

    //Open file for writing
    $ourFileName = '../../.htaccess';
    $fh = fopen($ourFileName, 'a') or die("Can't open file to write forum alias");

    //Start Writing
    $write1 = "\nRewriteCond %{SCRIPT_FILENAME} !-f\n";
    fwrite($fh, $write1);
    $write2 = "RewriteCond %{SCRIPT_FILENAME} !-d\n";
    fwrite($fh, $write2);
    $write3 = 'RewriteRule ^'.$spath.'/'.$go.'/(.+)$ /'.$spath.'/$1 [QSA,L]';
    fwrite($fh, $write3);
    $write4 = "\nRedirect 301 /".$spath."/".$go."/index.htm http://www.".$dname."/".$spath."/".$go."/index.php";
    fwrite($fh, $write4);
        $write5="
Redirect /$fname http://www.changeme.com/mybb/$fname";
        fwrite($fh, $write5);

    fclose($fh); //Close the file

//echo '<br>Done!';

*admin u may like to move this to the Modifications forum
Nice. Moving to modifications forum...

BMR777
i got a Question

can you give a demo of what that script does (shorter domain names ?? , whe got sub domain names to use :S or for what is this mod :S )

Greets From The Crasher
i would love to but im having problems with the script when its fixed i will post back!

basicaly its like a redirect from yoursite.com/forumname
to where its hosted yoursite.com/mybb/forumname

*edit* and its for use of the sub directory script *edit*
guys its stuffing up can u see any error in the script above?
i would be happy to help , but i cant work whit .htacces , only whit php ( a little )

what if you put a automatic redirection in to the .htacces ?? instead of in the php file ?? like the sub dom system

whit a wildcard like if you put http://www.yourforum.com/mybb/username/* to http://www.yourforum.com/mybb

and if it is ok then it will load every file that goes to the same to your /mybb instead of mybb/username

i dont know if it goin work ,but its just something you maybe can try out and let us hope that it works

i think i try to get what you mean , you try to make virtual dirs that get redirected to the forum
the problem it goin give (if you can make it ) is that every dir will be redirected to there (whit a lot of errors )

but you can try it , it will be nice if it works Smile

you can maybe search the net for virtual dir creator (i know that they exist somewhere , becouse they get used for file uploads )

Greets From The Crasher
Reference URL's