31
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.



32
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 ?



33
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'



34
disky
Searching in PDF files
  • 2005/11/26 23:06

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


Hi there

I have made a little PHP script that takes a directory full of PDF's convert them to text and insert them in to a MySQL table.

Not i would like to be able to include them in XOOPS search.

What would be the best and/or easiest way to do this ?

Should i 'just' hack the search.php file ?

Or would it be better to add a new module, with only search facility, and is this at all possible ?

I would prefer the last one, to make upgrading easier.

Best regards
Søren



35
disky
Re: Rewriting module URLs
  • 2005/11/26 14:57

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


Quote:

davidl2 wrote:
Check this news item for more information
https://xoops.org/modules/news/article.php?storyid=2704


Thanks david12 :)



36
disky
Re: Rewriting module URLs
  • 2005/11/26 14:56

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


If anyone need a mod_rewrite for 'mylinks' modules

here it is:

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

Instead of:
www.mydomain.com/modules/(mylinks/visit.php?cid=17&lid=22

you can now write:
www.mydomain.com/link/17/22



37
disky
Make mod_rewrite easier
  • 2005/11/26 13:10

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


When playing around with mod_rewrite to make URL's better for search engines, i had to do the following change:

In includes/common.php

Change:
$xoopsRequestUri = $_SERVER[ 'REQUEST_URI' ];
to:
$xoopsRequestUri = $_SERVER[ 'SCRIPT_NAME' ];

Then it is possible to use mod_rewrite to change URL's from

www.domain.com/modules/fsArticle/index.php?id=171

to maybe:

www.domain.com/article/171


Could this please be included in the core ?
The commont on that line actually says:
// Deprecated (use the corrected $_SERVER variable now)

I have had a site running with this for 6 month without any problems at all.

Best regards
Søren Reinke



38
disky
Re: Rewriting module URLs
  • 2005/11/26 13:04

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


Quote:

davidl2 wrote:
Disky - that's a very very nice site indeed!

I'll try this mod-rewrite hack myself - as it seems a very handy trick to use... I don't really understand it though :)

(Regarding your site - please submit it to StudioCs website competition... it's a very nice piece of work!)


Hi there

Glad you like it :)

Don't worry i don't really understand it myself, but it works :)

'StudioCs website' do you have an URL ?

Then i'll submit it when the new design is online.

Now the site should look more like a dive magazine :)



39
disky
Re: Rewriting module URLs
  • 2005/11/26 13:02

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


Quote:

Bassman wrote:
Nice site, you would not know it was a XOOPS site - nice customisation!

I wanted to change URLs fromhttp://www.mysite.com/modules/edito/content.php?id=1
tohttp://www.mysite.com/mynameformodule/id=1 and
http://www.mysite.com/modules/news/ tohttp://www.mysite.com/news/

Can you give me a specific rewrite rule for this?



Glad you like the site, but the new design that will be online in a few days is even better (i think).

I think you should add the following to your .htaccess file:

RewriteEngine On
RewriteBase /
RewriteRule ^mynameformodule/([0-9]+)$ /modules/edito/content.php?id=$1 [L]
ReWriteRule ^news /modules/news [L]


I made one little change,
Instead of:http://www.mysite.com/mynameformodule/id=1
I thinkhttp://www.mysite.com/mynameformodule/1
is better for search engines

If you want to be able to do
http://www.mysite.com/mynameformodule/1/ArticleHeadLine

change:
RewriteRule ^mynameformodule/([0-9]+)$ /modules/edito/content.php?id=$1 [L]
to
RewriteRule ^mynameformodule/([0-9]+)/.*$ /modules/edito/content.php?id=$1 [L]

Hope it works :)



40
disky
Re: Rewriting module URLs
  • 2005/11/23 9:30

  • disky

  • Just popping in

  • Posts: 90

  • Since: 2003/10/31


Hi there

I have this in my .htaccess file: (i added comments for this example, coments starts with -- remove before adding to your own .htaccess)


RewriteEngine On
RewriteBase /

--This line makes it possible to write:
--www.domain.com/article/17
--instead of
--www.domain.com/fsArticle/index.php?articleid=17
RewriteRule ^article/([0-9]+)$ /modules/fsArticle/index.php?articleid=$1 [L]

--This line makes it possible to write (search engine optimization):
--www.domain.com/article/17/This_Is_a_very_LOOOOOONG_URL
RewriteRule ^article/([0-9]+)/.*$ /modules/fsArticle/index.php?articleid=$1 [L]

--this is the same just for categories.
RewriteRule ^category/([0-9]+)$ /modules/fsArticle/index.php?categoryid=$1 [L]


I also had to change 1 line in includes/common.php
from:
$xoopsRequestUri = $_SERVER[ 'REQUEST_URI' ]; // Deprecated (use the corrected $_SERVER variable now)
to:
$xoopsRequestUri = $_SERVER[ 'SCRIPT_NAME' ];


I have no clue why they did not do this per default in the core ?

But at least it works.
You can see it in action here:
http://www.xray-mag.com/index.php

I hope it helps, else just write again.

I think your solution would be something like:
RewriteRule ^teachers/([0-9]+).html$ /modules/tinycontent1/index.php?ID=12$1 [L]

Best regards
Søren Reinke




TopTop
« 1 2 3 (4) 5 6 7 ... 9 »



Login

Who's Online

224 user(s) are online (121 user(s) are browsing Support Forums)


Members: 0


Guests: 224


more...

Donat-O-Meter

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

Latest GitHub Commits