xoops forums

kain

Just popping in
Posted on: 2003/6/4 11:53
kain
kain (Show more)
Just popping in
Posts: 56
Since: 2002/1/9 9
#1

apache and /modules/news

hi there,
my default module is news, any hint how to set up apache configuration to display http://www.foo.bar insted of http://www.foo.bar/modules/news ?
TIA

kain

Just popping in
Posted on: 2003/6/6 0:15
kain
kain (Show more)
Just popping in
Posts: 56
Since: 2002/1/9 9
#2

Re: apache and /modules/news

sorry for bumping..
I've tried the php way, but nothing, there are too many class/include to modify and I can't rewrite part of core to do this..
maybe mod_rewrite for apache can work, but I think if we write a rule that points again to document root it will results in an infinite loop (index.php <-> /modules/news/index.php).
I don't want to use frames.. nobody out there have tried to solve this problem?

ps. I use XOOPS 1.3.10

Nitou

Just popping in
Posted on: 2003/6/14 15:32
Nitou
Nitou (Show more)
Just popping in
Posts: 1
Since: 2002/12/8
#3

Re: apache and /modules/news

Use mod_rewrite :

in .htaccess :

RewriteEngine on
RewriteRule ^$ /modules/news/index.php [L]
RewriteRule ^index.php$ /modules/news/index.php [L]
RewriteRule ^index.html$ /modules/news/index.php [L]

at racine of website (/www/)!

kain

Just popping in
Posted on: 2003/6/14 22:14
kain
kain (Show more)
Just popping in
Posts: 56
Since: 2002/1/9 9
#4

Re: apache and /modules/news

simply great, thank you, it works.

sunsnapper

Friend of XOOPS
Posted on: 2003/11/5 8:16
sunsnapper
sunsnapper (Show more)
Friend of XOOPS
Posts: 403
Since: 2002/4/10
#5

Re: apache and /modules/news

For some reason, I'm not able to get this to work.

I note that you are using XOOPS 1.3.10.
I'm using XOOPS 2.0.5.

Scenario 1: No Error Message. Page loads properly.
Login and visit
http://www.brilliantenergy.com/modules/wfchannel/

MySQL/Blocks Debug Message
SELECT * FROM brilliant__modules WHERE dirname = 'wfchannel'


Scenario 2: Selected Module Does Not Exist
Login and visit
http://www.brilliantenergy.com/about/

MySQL/Blocks Debug Message
SELECT * FROM brilliant__modules WHERE dirname = 'http:'


Scenario 3: "Blank Page UGLY HTML"
Do not login... visit anonymously
http://www.brilliantenergy.com/about/

No MySQL/Blocks Debug Message Appears
Instead, I get a blank page comprised of HTML text in all caps.



Here are the mod_rewrite statements I am using:

RewriteEngine on
RewriteRule ^about/$ /modules/wfchannel/index.php?page=1 [L]
RewriteRule ^about$ /modules/wfchannel/index.php?page=1 [L]


I've also tried:

RewriteEngine on
RewriteRule ^about/$ http://www.brilliantenergy.com/modules/wfchannel/index.php?page=1 [L]
RewriteRule ^about$ http://www.brilliantenergy.com/modules/wfchannel/index.php?page=1 [L]



To rule out wfchannel, I also tried redirecting to newbb:

RewriteEngine on
RewriteRule ^about/$ /modules/newbb/ [L]
RewriteRule ^about$ /modules/newbb/ [L]


All result in the same blank page comprised of HTML that would not seem to match XOOPS XHTML compliant output.

I recognize that in Scenario 2, an invalid module directory is being passed to Xoops. What I am trying to understand better is why this approach worked in XOOPS 1.3.x and why login causes the different behavior between Scenario 2 and 3. Also, curious if people have guesses as to workarounds.

onokazu

XOOPS Founder
Posted on: 2003/11/5 9:37
onokazu
onokazu (Show more)
XOOPS Founder
Posts: 617
Since: 2001/12/13
#6

Re: apache and /modules/news

sunsnapper, try changing the following code around line 230 in common.php

$xoopsRequestUri = @xoops_getenv('REQUEST_URI');

to

$xoopsRequestUri = @xoops_getenv('SCRIPT_NAME');

sunsnapper

Friend of XOOPS
Posted on: 2003/11/5 15:00
sunsnapper
sunsnapper (Show more)
Friend of XOOPS
Posts: 403
Since: 2002/4/10
#7

Re: apache and /modules/news

Fantastic. Thank You! That does work.



(Note: see this thread for details about having site work with brilliantenergy.com vs. www.brilliantenergy.com)