11
Mamba
Re: URL changer
  • 2008/5/17 6:21

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


Quote:
As there was not much documentation, I had to puzzle a bit. I wrote a small manual:

How to rewrite URLs with the xoRewriteModule in XOOPS


Thank you Dona_brasil! That was very nice of you, and I'm sure, the XOOPS community appreciates it!
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

12
deka87
Re: URL changer
  • 2008/5/18 9:47

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


Quote:
You need to edit your header.php file in the root of your XOOPS site to add these lines:

//xoRewritemodule
$xoopsTpl =& $xoTheme->template;
$xoopsTpl->load_filter('output', 'xoRewriteModule');

I added these lines just before these two lines

$xoopsLogger->stopTime( 'XOOPS output init' );
$xoopsLogger->startTime( 'Module display' );


i use XOOPS 2.2 version and i dont have those lines. anywhere i add Quote:
//xoRewritemodule
$xoopsTpl =& $xoTheme->template;
$xoopsTpl->load_filter('output', 'xoRewriteModule');

i get a blank homepage. what is the problem?
Mind anchors

13
studioC
Re: URL changer
  • 2008/5/28 6:43

  • studioC

  • Friend of XOOPS

  • Posts: 922

  • Since: 2003/12/7


i'm also having the problem with a "white page", error:

Fatal error: Call to a member function load_filter() on a non-object in /srv/www/htdocs/web110/wwwroot/header.php on line 38
All errors (0) queries (4) blocks (0) extra (0) timers (3)

both on XOOPS 2.0.18.1 and XOOPS 2.30alpha3

with
//xoRewritemodule
$xoopsTpl =& $xoTheme->template;
$xoopsTpl->load_filter('output', 'xoRewriteModule');

in header.php

michael

14
studioC
Re: URL changer
  • 2008/5/28 18:08

  • studioC

  • Friend of XOOPS

  • Posts: 922

  • Since: 2003/12/7


well ... i figured it out for myself. Instead of adding the lines:

//xoRewritemodule
$xoopsTpl =& $xoTheme->template;
$xoopsTpl->load_filter('output', 'xoRewriteModule');

right at the beginning of my header.php like it was described in the howto i placed the lines right before the closing ?_> of the header.php

It seems that there is the need of some more stuff loaded in the header.php.
this seems to work for me!

Michael

15
frankblack
Re: URL changer
  • 2008/6/2 15:19

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


Everything works for me but there is minor drawback I could not explain. When the pagenav-class is used, the URLs will NOT be translated.

Anyone else having this problem? Or a hint?

16
frankblack
Re: URL changer
  • 2008/6/9 10:48

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


So finally I solved it by hacking the pagenav.php. Other drawbacks: some modules are working on the admin-side e.g. smartsection, search-results-URLs will not be changed (this needs another hack as well).

So my conclusion: xoRewriteModule is a nice starter, but not reliable yet. What I would like to see is a FULL translation of URLs, which takes the title of the document as the URL-name plus the ending with .htm.

This IS possible as it can be seen HERE. Not all URLs are translated correctly, but this seems to ME a good result so far.

Comments?

17
mrphilong
Re: URL changer
  • 2008/6/10 4:18

  • mrphilong

  • Quite a regular

  • Posts: 351

  • Since: 2006/7/14


hey frank,

I am having blank pages with xoRewriteModule for the news module, whats your .htaccess looks like for news module?

18
frankblack
Re: URL changer
  • 2008/6/10 6:27

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


The following lines should be best right before the closing php-tag of xoopsroot / header.php:
//xoRewritemodule
$xoopsTpl =& $xoTheme->template;
$xoopsTpl->load_filter('output''xoRewriteModule');


Your htaccess should look about like this:
RewriteEngine On
RewriteRule 
^newmodulename/(.*) /modules/news/$[QSA,L]


The file header.php inside modules / news (if there is any) should look like this (right before any other code):
if(strpos(getenv('REQUEST_URI'), '/modules/smartsection/') === 0)
{
$oldurl getenv('REQUEST_URI');
$newurl str_replace("modules/news""newmodulename"$oldurl); header("HTTP/1.1 301 Moved Permanently");
header("Location: $newurl");
}


Good luck!

19
php-deluxe
Re: URL changer
  • 2008/6/10 13:45

  • php-deluxe

  • Not too shy to talk

  • Posts: 135

  • Since: 2005/12/20


great work, frank!
i will testing the hack in next days.

sven

20
mrphilong
Re: URL changer
  • 2008/6/10 13:48

  • mrphilong

  • Quite a regular

  • Posts: 351

  • Since: 2006/7/14


Still getting blank page, thanks for your help.

Login

Who's Online

323 user(s) are online (253 user(s) are browsing Support Forums)


Members: 0


Guests: 323


more...

Donat-O-Meter

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

Latest GitHub Commits