11
Bassman
Re: Rewriting module URLs
  • 2005/11/27 3:41

  • Bassman

  • Friend of XOOPS

  • Posts: 1272

  • Since: 2003/5/23


just found this again...........thanks, i'm gonna try it out!

12
BengaliGuru
Re: Rewriting module URLs

Hi

I was trying to follow your example, still I could not get it working. I would really appreciate if anyone could help.

what I would like is
http://bengaliguru.com/modules/audio/index.php?page=1&p=Adhunik
tohttp://bengaliguru.com/audio/adhunik/


andhttp://bengaliguru.com/modules/newbb/viewforum.php?forum=1
tohttp://bengaliguru.com/forum/1/


I have added the following
RewriteEngine On
RewriteBase /
RewriteRule ^forum /modules/newbb [L]
ReWriteRule ^audio /modules/audio [L]

if I I typehttp://www.bengaliguru.com/audio/
I am redirected tohttp://www.bengaliguru.com/modules/audio/
however, I would prefer to seehttp://www.bengaliguru.com/audio/ instead ofhttp://www.bengaliguru.com/modules/audio/


Please help. Thanks

-S Khan

13
disky
Re: Rewriting module URLs
  • 2005/12/5 10:02

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


Hi BengaliGuru

I think this should work for you:
RewriteEngine On
RewriteBase /
ReWriteRule ^audio/(\w+)$ /modules/audio/index.php?page=1&p=$1 [L]
RewriteRule ^forum/([0-9]+)$ /modules/newbb/viewforum.php?forum=$1 [L]


If not just 'complain'

14
BengaliGuru
Re: Rewriting module URLs

Thanks for your reply.. but it did not work.

I have did some experiment and I found
RewriteEngine On
RewriteBase /
RewriteRule ^forum/$ /modules/newbb/ [L]
#RewriteRule ^forum/([0-9]+)/.*$ /modules/newbb/viewforum.php?forum=$1 [L]
ReWriteRule ^audio/$ /modules/audio/ [L]
RewriteRule ^audio/(.*)$ /modules/audio/index.php?page=1&p=$1 [L]


this seems to work, for example, if i typehttp://bengaliguru.com/audio/ I get desired page,
however, if I click on a link in /audio/( which is generated by zina module something like /modules/audio/index.php?p=1&p=Adhunik), then I gethttp://bengaliguru.com/modules/audio/index.php?p=1&p=Adunik.

How could I solve that problem?

Thanks
-S Khan
http://bengaliguru.com
Problem url:http://bengaliguru.com/modules/audio/
http://bengaliguru.com/modules/newbb/

15
disky
Re: Rewriting module URLs
  • 2005/12/6 8:45

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


Glad to hear you solved one part of your problem.

The new part you need to solve within the templates for that module, which at the moment makes a link like this:
http://bengaliguru.com/modules/audio/index.php?p=1&p=Adunik

The part of the template that outputs the link html you need to change to fit with your new URL system.

The templates can be found in /themes/NameOfYourTemplate/templates/NameOfModule/

Replace 'NameOfYourTemplate' and 'NameOfModule'.

Remember to enable 'Update module template .html files from themes/your theme/templates directory?' in System admin / preferences

p.s. Does your Forum URL rewrite actually work ?

16
BengaliGuru
Re: Rewriting module URLs

Thanks a lot for the help. I have got audio part working. I changed the zina script, it uses / instead of index.php?.

if I type bengaliguru.com/forum/, I get the forum. But from forum, if I open a topic, I still see viewforum.php?=.

Thanks
Sumon

17
disky
Re: Rewriting module URLs
  • 2005/12/7 8:21

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


you mean when you go here:http://bengaliguru.com/forum/
And click a link, then it still shows:http://bengaliguru.com/modules/newbb/viewforum.php?forum=1

in the URL ?

You need to change the template that displayes the list of forums to handle this.

18
defwind77
Re: Rewriting module URLs
  • 2005/12/7 9:55

  • defwind77

  • Not too shy to talk

  • Posts: 180

  • Since: 2005/11/11


where can I find the .htaccess file in my XOOPS install?

It'd be great if there was just one really detailed tutorial for this - as you say - I'm not sure why this isn't just a fixed part of xoops! I can't see why anyone would need or want ridiculously long titles! ;)

19
highlander
Re: Rewriting module URLs
  • 2005/12/7 10:34

  • highlander

  • Not too shy to talk

  • Posts: 151

  • Since: 2004/12/5


I doubt you'll find an .htaccess in your XOOPS installation. This is because .htaccess only works on Linux servers and not on windows machines.
This is also the reason it doesn't come as standard with xoops.

A good tutorial can be found here : here

Greetings Highlander

p.s. the link is dead at the moment (at least for me) so I cant verify if I've posted the right one. Should be ok though.
So, I'm in the park wondering why frisbees get larger as they get closer when suddenly, it hits me...
www.AnimalPedigree.com

20
dougfc5
Re: Rewriting module URLs
  • 2005/12/8 8:05

  • dougfc5

  • Just popping in

  • Posts: 39

  • Since: 2005/8/1 1


If "mylink" module has hundreds and even thousands of links, do I need to rewrite for each link? Then I will rewrite for hundred times. It may be a problem for me.

Is there any fast way to do it?


Thanks in advance!
doug

Login

Who's Online

179 user(s) are online (119 user(s) are browsing Support Forums)


Members: 0


Guests: 179


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