1
mikeytheman
Re: Re: Rewriting module URLs

Heh. I was actually looking at subdomain creation with php, mod_rewrite and wildcard dns. It allowed you to have subdomains that weren't really subdomains. Wait, maybe it didn't use mod_rewrite lol. I think it actually depended on the wildcard dns to allow for header information to redirect the user to the appropriate directory. Hmmm, maybe mod_rewrite was used. Anyways, the relative concept makes sense. I was just wondering how or if this was posible with xoops.



2
mikeytheman
Re: Rewriting module URLs

heh. Thank you ever so much. My next question might be a little more complicated.

I was wondering how to use mod_rewrite to my advantage with wildcard dns available to me. I'm thinking of using it to provide users with their own subdomain and had heard that this was posible with wildcard dns.



3
mikeytheman
Re: Rewriting module URLs

Heh. Okey, so i said to hell with cbb if it wasn't going to like mod_rewrite. Instead, I've gone with the x-ipb mod. What I'm curious about now is how to get the links within the module to point to the mod_rewritten location and work. I've got the basic .htaccess looking like this:
Quote:

RewriteEngine On
RewriteBase /
RewriteRule ^forum/$ /modules/ipboard/ [L]
RewriteRule ^forum$ /modules/ipboard/ [L]


But I'm wondering what I need to change to make it work for the rest of the module.

I was able to find the following in the /modules/ipboard/index.php file:
if ( $ibforums->session_type == 'cookie' )
{
    
$ibforums->session_id "";
    
$ibforums->base_url   $ibforums->vars['board_url'].'/index.'.$ibforums->vars['php_ext'].'?';
}
else
{
    
$ibforums->base_url $ibforums->vars['board_url'].'/index.'.$ibforums->vars['php_ext'].'?';
}

$ibforums->js_base_url $ibforums->vars['board_url'].'/index.'.$ibforums->vars['php_ext'].'?';


and realized that if i changed the $ibforums->js_base_url=$ibforums->vars['board_url'] to the location I needed, it'll somewhat work. However, it now goes to domain.com/forum/index.php?showthread=1.

What I'm wondering is, how would I modify it to have domain.com/forum/thread/1, domain.com/forum/forum/1, domain.com/forum/user/1 to suit index.php?showthread=1, index.php?showforum=1 and index.php?showuser=1 respectively.

Looking at it now, I'm thinking i'll have to change more than just the $ibforums->vars['board_url'] and probably have to figure out how to change the format of $ibforums->vars['php_ext'].

Any advice?



4
mikeytheman
Re: Rewriting module URLs

wow...that was great...thank you...i still have to figure out the cbb issue now lol



5
mikeytheman
Re: Rewriting module URLs

Quote:

disky wrote:
Hi Mikey

I must admit i can't really figure out if your solution will work or not.

But i think the problem you might have is, that NewBB has a problem with the URL's being rewriten, just like Xoops'es core file did have :(

Maybe ask or search on newbb's homepage, somebody might help. Or post a new thread on this site. I have never used newbb so i am not much help there :(


Yeah, it's definately NewBB (CBB) that's the problem. I hadn't even bothered doing the others before now, just because the forums was the main concern when we started looking at mod_rewriting things and stopped dead with that. All the others work great. My next question I guess is, how do (or can) you change it from being domain.com/news/ (with the last slash) to domain.com/news (without the lash)?



6
mikeytheman
Re: Rewriting module URLs

Alright, thinking about this problem I've got and trying to figure out solutions, would it be posible to have files in the root directory like
forum.php
games.php
etc with each module that would be in interest of being mod_rewritten

each php file would basically include the modules index file...and then use mod_rewrite to modify the urls on THAT php file...the only problem i forsee is the way that the modules files include it's dependencies...whether it just recurses from it's location or uses the XOOPS relative path...i think that made sense lol any suggestions?



7
mikeytheman
Re: Rewriting module URLs

Quote:

disky wrote:
Glad to hear that at least works :)

try with this:

RewriteEngine On
RewriteBase /
RewriteRule ^forum/([0-9]+)$ /modules/newbb/viewforum.php?forum=$1 [L]

And try 'www.mydomain.com/forum/1' or what the forum number might be.

Did you remember this part:

I also had to change 1 line in includes/common.php
from:
$xoopsRequestUri = $_SERVER[ 'REQUEST_URI' ]; // Deprecated (use the corrected $_SERVER variable now)
to:
$xoopsRequestUri = $_SERVER[ 'SCRIPT_NAME' ];

If i remember correctly you will actually get blank screen if you forgot it.

I have no clue why it is not done in the core system allready, they even themself write it is 'deprecated'.

heh...hadn't made the change in includes/common.php...however...that didn't help completely...it seems picky..

i was able to make the following work:
RewriteRule ^forum/$ /stuff/index.php [L]
then i tried
RewriteRule ^forum/$ /stuff/whatever/index.php [L]
but as soon as i tried
RewriteRule ^forum/$ /modules/newbb/index.php [L]
it gave me the 404

so i'm wondering what's going on that it doesn't like the modules forum...lol would it be a completely turned around and messed up attempt in trying to do
RewriteRule ^forum/$ /modules/
and then inside /stuff/
have another one that does
RewriteRule ^modules/$ /newbb/
or something of that nature? i don't know...i'm starting to get really confused with what's going on

any resolution or advice would be great :)



8
mikeytheman
Re: Rewriting module URLs

That worked lol. It's actually the first thing that's worked with any of the mod_rewrite examples that I've seen, anywhere. So, ummm, what was I doing wrong in my first example of code? (That was basically just copied from examples here)

:) thanx in advance btw...i'm seeming completely retarded with this...and i don't get what's wrong lol



9
mikeytheman
Re: Rewriting module URLs

I turned that on when I read this message, but this time in IE rather than FireFox like I had previously. Unlike Firefox though, instead of a blank screen though it displayed the Page Not Found so I'm now thinking it's probably my host. I emailed GoDaddy about this and they said they couldn't see anything wrong and asked for more details. Their support FAQ says they support mod_rewrite, so I'm not sure what I'm doing wrong.



10
mikeytheman
Re: Rewriting module URLs

I was able to copy the following from one of the posts in this thread and put it into an .htaccess file but when i try going to domain.com/forum or domain.com/forum/ i get the same thing for both...a blank screen...any help?
Quote:

RewriteEngine On
RewriteBase /
RewriteRule ^forum/$ /modules/newbb/ [L]
#RewriteRule ^forum/([0-9]+)/.*$ /modules/newbb/viewforum.php?forum=$1 [L]




TopTop
(1) 2 3 4 »



Login

Who's Online

243 user(s) are online (186 user(s) are browsing Support Forums)


Members: 0


Guests: 243


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