61
disky
Re: Rewriting module URLs
  • 2006/2/13 6:49

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


Are you sure you gave me the correct URL's to rewrite ?

In a XOOPS system a url like 'http://www.buzaulive.ro/modules/ ' does not make much sense, you need to specify a module after it.

Or did you actually mean:
http://www.buzaulive.ro/modules/A_MODULE_NAME

Where A_MODULE_NAME means any module no matter what ?

62
stelian
Re: Rewriting module URLs
  • 2006/2/13 12:25

  • stelian

  • Just popping in

  • Posts: 87

  • Since: 2005/12/17


Okay. I will be more specific.

from

http://www.buzaulive.ro/modules/catads/ i want
http://www.buzaulive.ro/buzau/anunturi/

from

http://www.buzaulive.ro/modules/friendfinder/ i want
http://www.buzaulive.ro/buzau/matrimoniale

from

http://www.buzaulive.ro/modules/xdirectory i want
http://www.buzaulive.ro/buzau/firme/

from

http://www.buzaulive.ro/modules/xcgal/ i want
http://www.buzaulive.ro/buzau/poze/

from

http://www.buzaulive.ro/modules/newbb/ (cbb1.16a) i want
http://www.buzaulive.ro/buzau/forum/
I think that newbb can't be rewriten, so.... SKIP :)

Anyway, it is not necesarely to be search user frendly url.
I just want like the URL to be desplayed like this.
Buzau is the name of the town where i live and buzau is the keyword that i try to optimize for google search.

Is it posible to get what i want? Thank you verry much.

63
disky
Re: Rewriting module URLs
  • 2006/2/14 21:58

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


If newbb works or not i dont know.

But the others i think you can do like this:

RewriteRule ^modules/catads/(.*)$ /buzau/anunturi/$1 [L]

The others should be just like the above one.

At the moment i am not able to test it, but give it a go :)

If they don't work, just 'complain' i should be able to test in next weekend.

64
stelian
Re: Rewriting module URLs
  • 2006/2/14 23:54

  • stelian

  • Just popping in

  • Posts: 87

  • Since: 2005/12/17


sorry, it is not working

i receive
Not Found
The requested URL /buzau/anunturi/ was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.34 Server at www.buzaulive.ro Port 80

Same with other modules too. I tried only
RewriteRule ^modules/catads/ /buzau/anunturi/

Same message. I'm wondering why?

65
disky
Re: Rewriting module URLs
  • 2006/2/15 6:49

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


You should have something after the url, like

www.mydomain.com/buzau/anunturi/index.php

Or whatever the file in that module you are trying to reach is called.

Any luck ?

66
saeed
Re: Rewriting module URLs
  • 2006/2/15 10:51

  • saeed

  • Not too shy to talk

  • Posts: 106

  • Since: 2004/9/27


hehey, nice topic!

but, friends,it's better to one of you who mastered in mod_rewrite ( disky), wite a article about XOOPS & mod_rewrite rules and publish it so everyone use it in his own

like myselg ,I dont know what to do but I ,hehe, I wish I had a full customized url's for my site
All about electronics and hardware:
HardWare Freaks!

67
stelian
Re: Rewriting module URLs
  • 2006/2/16 19:45

  • stelian

  • Just popping in

  • Posts: 87

  • Since: 2005/12/17


Hello. I found something else here:

http://www.peak.ne.jp/xoops/modules/news/article.php?storyid=54

I added some lines to mainfile.php
// modules changer
$GLOBALS['_rewriteRulesFrom'] = array(
'/buzau/',
'/anunturi/',
'/forum/',
'/matrimoniale/',
);

$GLOBALS['_rewriteRulesTo'] = array(
'/modules/',
'/catads/',
'/newbb/',
'/friendfinder/',
);

function 
modules_changer$s 
{
return 
str_replaceXOOPS_URL.'/modules/' XOOPS_URL.'/buzau/' $s) ;
return 
str_replaceXOOPS_URL.'/modules/catads/' XOOPS_URL.'/buzau/anunturi/' $s ) ;
return 
str_replaceXOOPS_URL.'/modules/newbb/' XOOPS_URL.'/buzau/forum/' $s ) ;
return 
str_replaceXOOPS_URL.'/modules/friendfinder/' ,  XOOPS_URL.'/buzau/matrimoniale/' $s ) ;
}
ob_start'modules_changer' ) ;
// modules changer


and some code to .htaccess

RewriteEngine on
RewriteRule 
^buzau/(.*)$ modules/$[L]
RewriteRule ^buzau/forum/(.*)$ modules/newbb/$[L]
RewriteRule ^buzau/anunturi/(.*)$ modules/catads/$[L]
RewriteRule ^buzau/matrimoniale/(.*)$ modules/friendfinder/$[L]


So, now i have something like this:
www.buzaulive.ro/buzau/*

and this is all. (www.buzaulive.ro/buzau/catads, www.buzaulive.ro/buzau/newbb, www.buzaulive.ro/buzau/friendfinder, etc .........)

newbb, catads, friendfinder, none of this modules change it's name. And i don't know why. Can any of you tell me?

If i make something like this
mainfile.php

// modules changer
$GLOBALS['_rewriteRulesFrom'] = array(
'/buzau/anunturi/',
'/buzau/forum/',
'/buzau/matrimoniale/',
);

$GLOBALS['_rewriteRulesTo'] = array(
'/modules/catads/',
'/modules/newbb/',
'/modules/friendfinder/',
);

function 
modules_changer$s 
{
return 
str_replaceXOOPS_URL.'/modules/catads/' XOOPS_URL.'/buzau/anunturi/' $s ) ;
return 
str_replaceXOOPS_URL.'/modules/newbb/' XOOPS_URL.'/buzau/forum/' $s ) ;
return 
str_replaceXOOPS_URL.'/buzau/friendfinder/' ,  XOOPS_URL.'/buzau/matrimoniale/' $s ) ;
}
ob_start'modules_changer' ) ;
// modules changer


.htaccess

RewriteEngine on
RewriteRule 
^buzau/forum/(.*)$ modules/newbb/$[L]
RewriteRule ^buzau/anunturi/(.*)$ modules/catads/$[L]
RewriteRule ^buzau/matrimoniale/(.*)$ modules/friendfinder/$[L]


I get this www.buzaulive.ro/buzau/anunturi/ (exactly what i want)and only this.
Other modules remains unchanged.

www.buzaulive.ro/modules/newbb/
www.buzaulive.ro/modules/friendfider/

Do i miss something? Please help.

68
disky
Re: Rewriting module URLs
  • 2006/2/16 20:07

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


Sorry i have no experience with that hack you are using.

Can't help you there.

But i guess the main problem is you are trying to change the 'modules' directory name.

69
stelian
Re: Rewriting module URLs
  • 2006/2/16 20:16

  • stelian

  • Just popping in

  • Posts: 87

  • Since: 2005/12/17


the mod_rewrite rules are the same like yours. Only in mainfile.php i help .htaccess a litle. (this is what i read in there :))

Your method does not work.
I thing i'll get crazy with this thing.

70
Ryansaw
Re: Rewriting module URLs
  • 2006/2/23 0:59

  • Ryansaw

  • Just popping in

  • Posts: 25

  • Since: 2005/3/6 1


Anyone know how to do a mod rewrite for CBB the 3.0 Module? This would be so benificial. Instead of having post id as page names, it would be great to have the subject be the page name.

Ryan Sawyer
http://www.wrapcandy.com/community/

Login

Who's Online

132 user(s) are online (92 user(s) are browsing Support Forums)


Members: 0


Guests: 132


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