31
kristarose
Re: URL changer - homepage redirect solution
  • 2008/7/18 18:27

  • kristarose

  • Just popping in

  • Posts: 28

  • Since: 2008/3/22


I just found this post and it's exactly what I've been looking for for weeks.

The code I'm using is:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/.+/
RewriteRule ^(index(.php|.html|.htm))?$ /modules/mastop_publish/ [L]

I'm trying to get it to work with the Content Module ver 0.5.

Mastop Publish, AMS, and other work great but not the Content Module which still displays the long URL.

Thanks in advance.

32
jayjay
Re: URL changer - homepage redirect solution
  • 2008/7/24 7:09

  • jayjay

  • Not too shy to talk

  • Posts: 175

  • Since: 2003/9/10


This is exactly the code I use. I do not know mastop_publish however. And I also don't understand what this "content module" has to do with masking "modules/mastop_publish" in urls? Could you please explain?

Please check that mod_rewrite is enabled on your Apache web server. You will normally notice this immediately when you use this code

33
demian
Re: URL changer
  • 2008/7/28 11:56

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29


hi..i tried to installed this plugin in xampp (mod-rewrite enabled check through phpinfo)

i want to try to use with the news module

after the setup in root/header.php

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

xoRewriteModule.ini.php
[xoRewriteModule]
 
news="news"

and making htacess
RewriteEngine on
RewriteRule 
^news/(.*) /modules/news/$[QSA,L]

and also news/header.php
if(strpos(getenv('REQUEST_URI'), '/modules/news/') === 0)
{
$oldurl getenv('REQUEST_URI');
$newurl str_replace("modules/news""news"$oldurl); header("HTTP/1.1 301 Moved Permanently");
header("Location: $newurl");
}


when i accesshttp://localhost/project/news/ i received a 404 error

while when i accesshttp://localhost/project/modules/news/

all the link is displayed ashttp://localhost/project/news/ but when i clicked any of the link I received 404 message..

anyone know how to fix this ? do i need anything in the xoRewriteHtaccess.ini.php
[xoRewriteHtaccess]
 
SERVER_NAME "localhost"
 
SERVER_ADDR "127.0.0.1"


the mod_rewrite is ok..in my other project using xampp it is working normally

34
demian
Re: URL changer
  • 2008/7/28 14:10

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29


when i use this in htaccess

RewriteRule ^news/(.*)$ modules/news/$[QSA,L]


instead of
RewriteRule ^news/(.*) /modules/news/$[QSA,L]


now its working

what is the difference ? what is QSA ?

35
demian
Re: URL changer
  • 2008/7/28 14:28

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29


in extcal theres no header.php

where do i put the redirect code ?

36
jayjay
Re: URL changer
  • 2008/7/28 14:35

  • jayjay

  • Not too shy to talk

  • Posts: 175

  • Since: 2003/9/10


QSA = query string append

Google is your friend

37
BigJim
Re: URL changer
  • 2008/10/25 7:20

  • BigJim

  • Just popping in

  • Posts: 78

  • Since: 2007/7/16


Hi there

can someone tell me how to use this to change only the name of the modules? I don't want to get rid of the /modules/ folder in the url?

thanks a lot!!!

38
pacho
Re: URL changer - string support for xoRewriteModule
  • 2009/3/13 20:51

  • pacho

  • Quite a regular

  • Posts: 235

  • Since: 2005/6/7 2


Very interesting conversation here. What is new about Trabis and JayJay discussion?

Thanks

39
trabis
Re: URL changer - string support for xoRewriteModule
  • 2009/3/13 22:15

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:

pacho wrote:
Very interesting conversation here. What is new about Trabis and JayJay discussion?

Thanks


I'm using xoRewrite method in defacer but with some diferences.
There is only on line in htaccess and redirection is handled by a file.


btw, there is a bug in xoRewriteModule smarty plugin

make it like this:
$_SERVER['REQUEST_URI'] = str_replace$value 'modules/'.$key , @$_SERVER['REQUEST_URI'] ) ;
            
$_SERVER['HTTP_REFERER'] = str_replace$value 'modules/'.$key , @$_SERVER['HTTP_REFERER'] ) ;



40
geopro
Re: URL changer
  • 2009/11/13 16:59

  • geopro

  • Just popping in

  • Posts: 17

  • Since: 2007/10/20


Is there a soluttion for string support for xoRewriteModule ?

Login

Who's Online

261 user(s) are online (168 user(s) are browsing Support Forums)


Members: 0


Guests: 261


more...

Donat-O-Meter

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

Latest GitHub Commits