31
deka87
Re: HOWTO: xoRewriteModule - Simplified, Short URLs (remove /modules)
  • 2009/10/18 13:52

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


neat explanation. got it working in 5 minutes. thanks!

ps is it safe to use it with profile? like /users instead of modules/profile

32
mboyden
Re: HOWTO: xoRewriteModule - Simplified, Short URLs (remove /modules)
  • 2009/10/21 13:36

  • mboyden

  • Moderator

  • Posts: 484

  • Since: 2005/3/9 1


by deka87 on 2009/10/18 8:52:45 Quote:
ps is it safe to use it with profile? like /users instead of modules/profile

It's worked for me on every module so far. As long as the module doesn't go outside of smarty templates (highly unrecommended).

33
deka87
Re: HOWTO: xoRewriteModule - Simplified, Short URLs (remove /modules)
  • 2009/10/26 14:57

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


mboyden, came up with an issue. if you go directly to http://www.mysite.com/forums/ (newbb in past) or any rewritten module url it gives you a blank page. however, refreshing the page solves the problem. if you click on a link that leads to this page it's alright, but if you type in th url in the browser address window it has that problem. clearing the cache didn't solve the problem.

34
ghia
Re: HOWTO: xoRewriteModule - Simplified, Short URLs (remove /modules)
  • 2009/10/26 15:23

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Quote:
As an example, for the tag module, add the following code to /modules/tag/header.php (right at the top below the comments):
if (strpos(getenv('REQUEST_URI'), '/modules/tag/') === 0) {
    
$oldurl getenv('REQUEST_URI');
    
$newurl str_replace("modules/tag""tags"$oldurl);
    
header("HTTP/1.1 301 Moved Permanently");
    
header("Location: $newurl");
}

Did you put a similar code in your module?
Seems to me it is wrong and should be:
if (strpos(getenv('REQUEST_URI'), '/modules/tag/') === 0) { ; } else {




35
deka87
Re: HOWTO: xoRewriteModule - Simplified, Short URLs (remove /modules)
  • 2009/10/26 15:42

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


Quote:

Did you put a similar code in your module?
Seems to me it is wrong and should be:


Yes, I put that code. I corrected it the way you said, but it caused a loop.

36
ghia
Re: HOWTO: xoRewriteModule - Simplified, Short URLs (remove /modules)
  • 2009/10/26 16:07

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Maybe
if (strpos(getenv('REQUEST_URI'), '/modules/tag/') === false) { ; } else {
?

37
deka87
Re: HOWTO: xoRewriteModule - Simplified, Short URLs (remove /modules)
  • 2009/10/26 19:18

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


it works now. thanks, ghia!

38
webmystar
xoRewriteModule and XOOPS-2.3.3
  • 2009/11/17 13:03

  • webmystar

  • Friend of XOOPS

  • Posts: 415

  • Since: 2008/6/23


After the update from XOOPS-2.3.2b to XOOPS-2.3.3 i have problems with the Rewrite at my start page (xoRewriteModule : NOT Loaded). On the undersides (Debug: plugin smarty for XOOPS => xoRewriteModule : Loaded) everything works fine, but at my start page, i have the old url structure.

PHP Version - 5.2.6-1+lenny3

Do you have an tip for me? Thank you!

39
webmystar
Re: HOWTO: xoRewriteModule - Simplified, Short URLs (remove /modules)
  • 2009/11/17 16:31

  • webmystar

  • Friend of XOOPS

  • Posts: 415

  • Since: 2008/6/23


I have found the problem:

header.php
// Tricky solution for setting cache time for homepage 
}  elseif (!empty($xoopsOption['template_main'])) {         $xoTheme->contentCacheLifetime 604800; }


The problem is the XOOPS Caching in combination with the XoRewrite Hack.

Maybe i will test this Hack for the cache:
http://xoops.peak.ne.jp/md/mydownloads/singlefile.php?lid=67&cid=2

40
bjuti
Re: HOWTO: xoRewriteModule - Simplified, Short URLs (remove /modules)
  • 2009/11/18 23:44

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


Does it work on 2.3< ?

Login

Who's Online

323 user(s) are online (179 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