Forum Moderators: coopster

Message Too Old, No Replies

compatibility of mod_rewrite with php environment variables

         

scorpion

8:33 pm on Oct 9, 2003 (gmt 0)

10+ Year Member



Has anybody experienced an issue with rewriting a domain and having the PHP_SELF variable incorrectly identifying the rewrite?

Example:

PHP_SELF = [mysite.com...]

when the rewrite is:

RewriteCond %{HTTP_HOST} [^.]*mysite\.com$
RewriteCond %{REQUEST_URI}!^/mysite/
RewriteRule ^(.*)$ /mysite/$1 [L]

Namely, the extra appending of the host name as a subdirectory in the rewrite...

jatar_k

5:30 pm on Oct 11, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



The filename of the currently executing script, relative to the document root. For instance, $_SERVER['PHP_SELF'] in a script at the address [example.com...] would be /test.php/foo.bar.

so

PHP_SELF = [mysite.com...]

shouldn't be what you get anyway. It should be '/mysite/index.php' or whatever.

scorpion

9:14 pm on Oct 13, 2003 (gmt 0)

10+ Year Member



sorry that is correct, you get /mysite/index.php and that would be wrong because if the rewrite is correct you'll get

[mysite.com...]

is there a way to get it to be just [mysite.com...]