Forum Moderators: phranque

Message Too Old, No Replies

Mod_rewrite for subdomain, which redirect to root script

         

neobyte

5:32 pm on Jan 6, 2006 (gmt 0)

10+ Year Member



I need to call from subdomain the index.php script with parameters, but I need to mask the URL. If I make it with the full address ( [.......] ), it goes, but the URL is not masked:


RewriteEngine On
RewriteRule index\.html www.domain.com/index.php?id=value

To mask the URL I need to write logical address ( script is under 2 directories - _sub/subdomain/ )

[code]
RewriteEngine On
RewriteRule index\.html ../../index.php?id=value

But this is not functional - error 404. Can you help me, please? Can I swap the string "../../" with any, which can mod_rewrite accept? I tried soft link ( like /server/domain/www/index.php?id=value ), but it doesnt work.

jd01

8:47 pm on Jan 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi neobyte,

Welcome to WebmasterWorld.

I am not sure I understand the question or what you are trying to accomplish...

Is the index.php on the sub-domain, but needing to be opened/executed on the TLD? If so, you will need to use a [P] proxy flag to keep from redirecting.

What do you mean by logical? Do you need to open the index.php of a specific directory?

EG
/somedir/anotherdir/somefile.html should open /somedir/anotherdir/index.php?someparam

OR
/somedir/anotherdir/somefile.html should open /yetanotherdir/onemoredir/index.php?someparam

OR
/somedir/anotherdir/somefile.html should open /index.php?someparam

Please, let us know exactly what you are looking for --- (Maybe it's there and I am not seeing it, but I am kind of slow some times.)

Justin

neobyte

11:08 pm on Jan 6, 2006 (gmt 0)

10+ Year Member



Hi Justin,

index.php is on TLD - for example www.tld.com. I have there www.tld.com/index.php?search=value. I need to have subdomains searched_text.tld.com - which will open www.tld.com/index.php?search=searched_text ( but not automaticaly - becouse I have some subdomains, which I need to stay functional ).

Sorry for confusing you :-)

neobyte

8:13 am on Jan 9, 2006 (gmt 0)

10+ Year Member



I have some news about it.

I have found one admin, who said, that this error is occured by the newest version of php4 ( I have on the server php 4.4.1 ). He said, that this was functional with older versions of php4. After updating to php 4.4.1, rewrite rules from subdomain to root scripts crashed...