LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-10-2006, 08:43 PM   #1
eugene2008
LQ Newbie
 
Registered: Jul 2006
Posts: 8

Rep: Reputation: 0
After trying to make virtual subdomains with mod_rewriting


After trying to make virtual subdomains with mod_rewriting for phpbb multiforums script
Any variables are not being passed at all to php scripts, e.g profile.php does not see any variables, admin/index.php and so on...
Register Global, arrays, argv all set on.

Some technical details

.htaccess on root folder
RewriteEngine on
ReWriteCond %{HTTP_HOST} !^$
ReWriteCond %{HTTP_HOST} !www\.talkorchat\.com
ReWriteCond %{HTTP_HOST} (.*)\.talkorchat\.com
ReWriteRule (.*) seo.php?multiusername=%1


Seo.php
<?php
//$multiusername = $_SERVER['REQUEST_URI'];
//$multiusername = "zzz";
echo "seo mode ".$mode;
define("MFORUM", $multiusername);

include('multiconfig.php');
include('config.php');

$file = $_SERVER['REQUEST_URI'];
$file = "/".$multiusername.$_SERVER['REQUEST_URI'];
//echo " URI $file";

if($script_path)
{
$slash = '/';
}
// /phppbb/zzz/
$replace = $slash.$script_path.'/'.MFORUM.'/';

//$replace = "/".$multiusername."/";


…………………

profile.php

if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )

{
$mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
$mode = htmlspecialchars($mode);

if ( $mode == 'viewprofile' )



………………

testing with normal URL http://talkorchat.com/zzz.php?mode=ok
it is ok QUERY STRING is set and zzz.php script response with $mode=ok

PHP VariablesVariable Value
PHP_SELF /zzz.php
_REQUEST["mode"] ok
_GET["mode"] ok
_SERVER["AuthDigestEnableQueryStringHack"] On
_SERVER["SCRIPT_URL"] /zzz.php
_SERVER["SCRIPT_URI"] http://talkorchat.com/zzz.php
_SERVER["HTTP_USER_AGENT"] Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 9.01
_SERVER["HTTP_HOST"] talkorchat.com
_SERVER["HTTP_ACCEPT"] text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
_SERVER["HTTP_ACCEPT_LANGUAGE"] ru,en;q=0.9
_SERVER["HTTP_ACCEPT_CHARSET"] iso-8859-1, utf-8, utf-16, *;q=0.1
_SERVER["HTTP_ACCEPT_ENCODING"] deflate, gzip, x-gzip, identity, *;q=0
_SERVER["HTTP_CACHE_CONTROL"] no-cache
_SERVER["HTTP_CONNECTION"] Keep-Alive, TE
_SERVER["HTTP_TE"] deflate, gzip, chunked, identity, trailers
_SERVER["PATH"] C:\Perl\bin\;C:\server\xampp\perl\bin\;c:\server\xampp\imagic;C:\WINDOWS\system32;C:\WINDOWS;C:\WIND OWS\System32\Wbem
_SERVER["SystemRoot"] C:\WINDOWS
_SERVER["COMSPEC"] C:\WINDOWS\system32\cmd.exe
_SERVER["PATHEXT"] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
_SERVER["WINDIR"] C:\WINDOWS
_SERVER["SERVER_SIGNATURE"] <address>Apache/2.2.2 (Win32) DAV/2 mod_ssl/2.2.2 OpenSSL/0.9.8b mod_autoindex_color PHP/5.1.4 Server at talkorchat.com Port 80</address>
_SERVER["SERVER_SOFTWARE"] Apache/2.2.2 (Win32) DAV/2 mod_ssl/2.2.2 OpenSSL/0.9.8b mod_autoindex_color PHP/5.1.4
_SERVER["SERVER_NAME"] talkorchat.com
_SERVER["SERVER_ADDR"] 62.141.48.86
_SERVER["SERVER_PORT"] 80
_SERVER["REMOTE_ADDR"] 87.119.168.66
_SERVER["DOCUMENT_ROOT"] C:/aweb/talkorchat.com/
_SERVER["SERVER_ADMIN"] admin@localhost
_SERVER["SCRIPT_FILENAME"] C:/aweb/talkorchat.com/zzz.php
_SERVER["REMOTE_PORT"] 61357
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["SERVER_PROTOCOL"] HTTP/1.1
_SERVER["REQUEST_METHOD"] GET
_SERVER["QUERY_STRING"] mode=ok
_SERVER["REQUEST_URI"] /zzz.php?mode=ok
_SERVER["SCRIPT_NAME"] /zzz.php
_SERVER["PHP_SELF"] /zzz.php
_SERVER["REQUEST_TIME"] 1157924913
_SERVER["argv"] Array
_SERVER["argc"] 1




http://zzz.talkorchat.com/zzz.php?mode=ok
PHP Variables
Variable Value
PHP_SELF /seo.php
_REQUEST["multiusername"] zzz
_REQUEST["ok"] yes
_REQUEST["ViewCookie"] true
_REQUEST["ForumSetCookie"] xxx
_REQUEST["phpbb_aaa_data"] a:2:{s:11:\"autologinid\";s:32:\"12473402644ff4b2faf6179.33242983\";s:6:\"userid\";i:2;}
_REQUEST["phpbb_xxx_data"] a:2:{s:11:\"autologinid\";s:0:\"\";s:6:\"userid\";i:-1;}
_REQUEST["phpbb2mysql_data"] a:2:{s:11:\"autologinid\";s:0:\"\";s:6:\"userid\";i:-1;}
_GET["multiusername"] zzz
_GET["ok"] yes
_COOKIE["ViewCookie"] true
_COOKIE["ForumSetCookie"] xxx
_COOKIE["phpbb_aaa_data"] a:2:{s:11:\"autologinid\";s:32:\"12473402644ff4b2faf6179.33242983\";s:6:\"userid\";i:2;}
_COOKIE["phpbb_xxx_data"] a:2:{s:11:\"autologinid\";s:0:\"\";s:6:\"userid\";i:-1;}
_COOKIE["phpbb2mysql_data"] a:2:{s:11:\"autologinid\";s:0:\"\";s:6:\"userid\";i:-1;}
_SERVER["REDIRECT_AuthDigestEnableQueryStringHack"] On
_SERVER["REDIRECT_STATUS"] 200
_SERVER["AuthDigestEnableQueryStringHack"] On
_SERVER["HTTP_ACCEPT"] */*
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-us
_SERVER["HTTP_UA_CPU"] x86
_SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate
_SERVER["HTTP_USER_AGENT"] Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322)
_SERVER["HTTP_HOST"] zzz.talkorchat.com
_SERVER["HTTP_CONNECTION"] Keep-Alive
_SERVER["HTTP_COOKIE"] ViewCookie=true; ForumSetCookie=xxx; phpbb_aaa_data=a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A32%3A%2212473402644ff4b2faf6179.33242983% 22%3Bs%3A6%3A%22userid%22%3Bi%3A2%3B%7D; phpbb_xxx_data=a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A0%3A%22%22%3Bs%3A6%3A%22userid%22%3Bi%3A-1%3B%7D; phpbb2mysql_data=a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A0%3A%22%22%3Bs%3A6%3A%22userid%22%3Bi%3 A-1%3B%7D
_SERVER["PATH"] C:\Perl\bin\;C:\server\xampp\perl\bin\;c:\server\xampp\imagic;C:\WINDOWS\system32;C:\WINDOWS;C:\WIND OWS\System32\Wbem
_SERVER["SystemRoot"] C:\WINDOWS
_SERVER["COMSPEC"] C:\WINDOWS\system32\cmd.exe
_SERVER["PATHEXT"] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
_SERVER["WINDIR"] C:\WINDOWS
_SERVER["SERVER_SIGNATURE"] <address>Apache/2.2.2 (Win32) DAV/2 mod_ssl/2.2.2 OpenSSL/0.9.8b mod_autoindex_color PHP/5.1.4 Server at zzz.talkorchat.com Port 80</address>
_SERVER["SERVER_SOFTWARE"] Apache/2.2.2 (Win32) DAV/2 mod_ssl/2.2.2 OpenSSL/0.9.8b mod_autoindex_color PHP/5.1.4
_SERVER["SERVER_NAME"] zzz.talkorchat.com
_SERVER["SERVER_ADDR"] 62.141.48.86
_SERVER["SERVER_PORT"] 80
_SERVER["REMOTE_ADDR"] 62.141.48.86
_SERVER["DOCUMENT_ROOT"] C:/aweb/talkorchat.com/
_SERVER["SERVER_ADMIN"] admin@localhost
_SERVER["SCRIPT_FILENAME"] C:/aweb/talkorchat.com/seo.php
_SERVER["REMOTE_PORT"] 4907
_SERVER["REDIRECT_QUERY_STRING"] multiusername=zzz&ok=yes
_SERVER["REDIRECT_URL"] /zzz.php
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["SERVER_PROTOCOL"] HTTP/1.1
_SERVER["REQUEST_METHOD"] GET
_SERVER["QUERY_STRING"] multiusername=zzz&ok=yes
_SERVER["REQUEST_URI"] /zzz.php?mode=ok
_SERVER["SCRIPT_NAME"] /seo.php
_SERVER["PHP_SELF"] /seo.php
_SERVER["REQUEST_TIME"] 1157925274
_SERVER["argv"] Array
_SERVER["argc"] 1

How to solve this problem?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make the virtual teminals scroll when swapped rednuht Linux - General 3 08-24-2006 12:30 PM
make wildcard subdomains on localhost work edman007 Linux - Networking 5 09-03-2005 02:41 PM
Subdomains on Apache2 with virtual hosts - how? <Ol>Origy Linux - Networking 2 08-18-2005 06:53 AM
is there a way to make a 'real' virtual interface? Taishan269 Linux - Networking 0 12-17-2003 03:33 PM
how do i make subdomains on my webpage matt_w_lambert Linux - General 2 10-30-2003 12:51 AM


All times are GMT -5. The time now is 10:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration