1
manuel
Use REQUEST_URI instead of PHP_SELF generally? (Core problem)
  • 2004/5/24 17:52

  • manuel

  • Just popping in

  • Posts: 3

  • Since: 2004/2/25


Hi!

I've have a problem with a solution (also others too as this thread shows)

The problem is that in some places withing XOOPS (I'm using 2.0.6) that the global PHP_SELF variable is used to create urls (forms,navigation,etc) and configured sites like mine (an maybe more users) that uses apache .htaccess with modrewrite configured to handle multiple domains with only one account.

Let me show my configuration for more clearness:

I own 1 hosting solution that I will call myhost.com, and I also have pointing to this host a couple of more domains.
So domain1.com and domain2.com -> points to myhost.com.
But thanks to modrewrite I change the url for every domainX to a subdirectory withing myhost.com htdocs
I have XOOPS installed in each subdirectory (and, of course, visible fromhttp://domain1.com andhttp://domain2.com)-

Here is my .htaccess:

Quote:

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} domain1.com
RewriteCond %{REQUEST_URI} !domain1_com/
RewriteRule ^(.*)$ domain1_com/$1 [L]
RewriteCond %{HTTP_HOST} domain2.com
RewriteCond %{REQUEST_URI} !domain2_com/
RewriteRule ^(.*)$ domain2_com/$1 [L]


That causes to php self to pointo to /domain1_com/index.php but it's needed to point to /index.php.

I changed a couple of scripts from XOOPS (see above forum link), eg: /class/pagenav.php, to use some code like this:
Quote:

$submit_page = $HTTP_SERVER_VARS['REQUEST_URI'];
if(strpos($submit_page,"?")) $submit_page = substr($submit_page,0,strpos($submit_page,"?"));

instead of
Quote:

$submit_page = $HTTP_SERVER_VARS['PHP_SELF']


Am I wrong and should learn more about url rewriting or should change XOOPS developers to use the request uri (without get params) instead of php_self?

Login

Who's Online

149 user(s) are online (88 user(s) are browsing Support Forums)


Members: 0


Guests: 149


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits