21
highlander
Re: Rewriting module URLs
  • 2005/12/8 9:57

  • highlander

  • Not too shy to talk

  • Posts: 151

  • Since: 2004/12/5


Sorry, gave you the wrong link last time.

Here is the correct link : LINK

You should need to write just one rule which will convert all your *mylinks* urls.

greetings Highlander
So, I'm in the park wondering why frisbees get larger as they get closer when suddenly, it hits me...
http://www.AnimalPedigree.com

22
disky
Re: Rewriting module URLs
  • 2005/12/8 10:20

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


Quote:

dougfc5 wrote:
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?
doug


If you use mod_rewrite you make 1 rewrite and it handles them all :) If they have the same schema :)

23
dougfc5
Re: Rewriting module URLs
  • 2005/12/8 13:08

  • dougfc5

  • Just popping in

  • Posts: 39

  • Since: 2005/8/1 1


Is it the rule, right ? Sorry for this silky question as I do not know this skill before.

RewriteRule ^link/([0-9]+)/([0-9]+)$ /modules/mylinks/visit.php??cid=$1&lid=$2 [L]

Thanks a lot!
doug

24
disky
Re: Rewriting module URLs
  • 2005/12/8 13:16

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


Hi Doug

It looks okay to me :)

I use it on my server, and there it works :)

/Søren

25
dougfc5
Re: Rewriting module URLs
  • 2005/12/8 14:30

  • dougfc5

  • Just popping in

  • Posts: 39

  • Since: 2005/8/1 1


Hi disky

Thanks again! Totally understand now.

doug

26
disky
Re: Rewriting module URLs
  • 2005/12/9 8:59

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


I just found out that if i added a / after the last number in the mylink url it failed, so i added this line to .htaccess as well:
RewriteRule ^link/([0-9]+)/([0-9]+)/.*$ /modules/mylinks/visit.php?cid=$1&lid=$2 [L]

Now it works,

You can write:

http://www.mydomain.com/link/10/18/I_think_this_is_a_very_cool_link

27
dougfc5
Re: Rewriting module URLs
  • 2005/12/9 17:00

  • dougfc5

  • Just popping in

  • Posts: 39

  • Since: 2005/8/1 1


disky

I try it tonight in order to change

from:
http://www.mysite.com/modules/contact/

to:
http://www.mysite.com/contact

by

RewriteEngine On
RewriteBase /
RewriteRule ^contact /modules/contact [L]

in .htaccess file

and change 1 line in include/common.php
from:
$xoopsRequestUri=$_SERVER['REQUEST_URI'] ;
to:
$xoopsRequestUri=$_SERVER['SCRIPT_NAME'];

Then each time when I go to mysite.com/contact, it can redirectly to mysite.com/modules/contact . When I tick the 'contact' on the 'main menu', I still see http://mysite.com/modules/contact on url .

But what I want is only see mysite.com/contact appearing on my site.

How can do that?

Thanks in advance!

28
disky
Re: Rewriting module URLs
  • 2005/12/11 9:31

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


Hi Dougfc5

'Then each time when I go to mysite.com/contact, it can redirectly to mysite.com/modules/contact .'

So when you go to 'mysite.com/contact' you see that site, and the url is still 'mysite.com/contact' ?

'When I tick the 'contact' on the 'main menu', I still see http://mysite.com/modules/contact on url .'

You have to change the template for that module that outputs that link. Maybe it is just in your theme.html file for the selected theme.

29
dougfc5
Re: Rewriting module URLs
  • 2005/12/11 18:07

  • dougfc5

  • Just popping in

  • Posts: 39

  • Since: 2005/8/1 1


disky

Thanks again!

I will use Simplified URLs Hack to solve the problem.

doug

30
mikeytheman
Re: Rewriting module URLs

I was able to copy the following from one of the posts in this thread and put it into an .htaccess file but when i try going to domain.com/forum or domain.com/forum/ i get the same thing for both...a blank screen...any help?
Quote:

RewriteEngine On
RewriteBase /
RewriteRule ^forum/$ /modules/newbb/ [L]
#RewriteRule ^forum/([0-9]+)/.*$ /modules/newbb/viewforum.php?forum=$1 [L]

Login

Who's Online

146 user(s) are online (109 user(s) are browsing Support Forums)


Members: 0


Guests: 146


more...

Donat-O-Meter

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

Latest GitHub Commits