1
DonCurioso
Canonical URI´s over Xoops

Hi,

we believe with Celseven, our programming partners than we will found a solution to have canonical URL under Xoops.

Create a file. Htaccess with the following code:
Options FollowSymlinks
RewriteEngine on
RewriteCond 
%{ HTTP_HOST }^hispaxoops.com NC ]
RewriteRule ^(.*)$ http://www.hispaxoops.com/$1 [L,R=301]


Change this domain for yours, save and upload to your XOOPS folder.

Edit header php, around line 69 and include these lines:

//www.celseven.com - Definir URL Canónica - XOOPS
echo "<link rel='canonical' href='".XOOPS_URL.$_SERVER['REQUEST_URI']."'/>" ;
//www.celseven.com - URL Canónica definida


Save&upload.
That´s all !!! It´s working for us... what about you ?

All info here.


Suggestions, comments... all welcome !!!
HispaXoops | Xoops España

That's the way i like it! | Nada mejor que una Alhambra bien helada con aceitunas...

2
bjuti
Re: Canonical URI´s over Xoops
  • 2009/7/17 9:35

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


Does not work for me... I got "Internal Server error"...

3
pw-kw
Re: Canonical URI´s over Xoops
  • 2009/7/17 9:54

  • pw-kw

  • Just popping in

  • Posts: 50

  • Since: 2007/2/1 8


test this ... for me ... it works fine:

RewriteEngine On 
RewriteCond 
%{HTTP_HOST}   !^www.your-domain.com [NC
RewriteCond %{HTTP_HOST}   !^$ 
RewriteRule ^(.*)$ http://www.your-domain.com/$1 [L,R=301]

4
anderssk
Re: Canonical URI´s over Xoops
  • 2009/7/17 10:35

  • anderssk

  • Quite a regular

  • Posts: 335

  • Since: 2006/3/21


Try post without code-tags - please.
The code-tags mess things up

5
bjuti
Re: Canonical URI´s over Xoops
  • 2009/7/17 13:40

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


when i do:

RewriteCond %{HTTP_HOST}   !^www.your-domain.com [NC]  RewriteCond %{HTTP_HOST}   !^$  RewriteRule ^(.*)$ http://www.your-domain.com/$1 [L,R=301]


it works, but i can't go to the other pages in news which is landing module, using the navigation 1, 2, 3.. page...

when i say that it works, i mean that i don't get a server error, but cannonical dosen't work.. stil is www.mysite.com/index.php

maybe coz i have url rewrite smarty module turned on..

6
DonCurioso
Re: Canonical URI´s over Xoops

Hi everybody,

many servers couldn't accept Options + FollowSymlinks, i don't all reasons, of curse. If you get an error 500 or blank page, try without this.

bjuti,

we have rewrite turned on too & doesn't matter, all it´s ok.

pw-kw & bjuti,

read again your codes, they're wrong.

First rule after Rewrite Engine On defines if you want your domain with or without www, please, check it. I feel you´ve error there.

Copy&paste my code, remove some spaces, wirte there your domain & it works!

Regards.
HispaXoops | Xoops España

That's the way i like it! | Nada mejor que una Alhambra bien helada con aceitunas...

7
bjuti
Re: Canonical URI´s over Xoops
  • 2009/7/18 10:24

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


This is my .htaccess

Quote:
Options + FollowSymLinks
RewriteEngine On

RewriteCond %{ HTTP_HOST }^mysite.com [ NC ]
RewriteRule ^(.*)$http://www.mysite.com/$1 [L,R=301]
RewriteRule ^vesti/(.*) /modules/news/$1 [QSA,L]
RewriteRule ^tekstovi/(.*) /modules/smartsection/$1 [QSA,L]
RewriteRule ^tekstovi\.([a-z]+)\.([0-9.]+)/ modules/smartsection/seo.php?seoOp=$1&seoArg=$2
RewriteRule ^download/(.*) /modules/wfdownloads/$1 [QSA,L]
RewriteRule ^rss/(.*) /modules/rss/$1 [QSA,L]
RewriteRule ^mapa-sajta/(.*) /modules/sitemap/$1 [QSA,L]
RewriteRule ^kontakt/(.*) /modules/liaise/$1 [QSA,L]
RewriteRule ^casopis/(.*) /modules/mastop_publish/$1 [QSA,L]
RewriteRule ^blog/(.*) /modules/planet/$1 [QSA,L]
RewriteRule ^tekstovi-glavna/(.*) /modules/tekstovinovo/$1 [QSA,L]

ErrorDocument 404 /404.html


And it still does not work. :) What I'm doing wrong?

It doesn't work with this also:

Quote:
Options +FollowSymLinks


When I put just:
Quote:
RewriteRule ^(.*)$http://www.mysite.com/$1 [L,R=301]


I got:

Quote:
The page isn't redirecting properly


Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

* This problem can sometimes be caused by disabling or refusing to accept cookies.

8
DonCurioso
Re: Canonical URI´s over Xoops

Hi,

i´ll try on plain text

---------------------------------------------------------------
RewriteEngine On

RewriteCond %{HTTP_HOST} ^mysite.com [NC]
RewriteRule ^(.*)$http://www.mysite.com/$1 [L,R=301]
RewriteRule ^vesti/(.*) /modules/news/$1 [QSA,L]
RewriteRule ^tekstovi/(.*) /modules/smartsection/$1 [QSA,L]
RewriteRule ^tekstovi\.([a-z]+)\.([0-9.]+)/ modules/smartsection/seo.php?seoOp=$1&seoArg=$2
RewriteRule ^download/(.*) /modules/wfdownloads/$1 [QSA,L]
RewriteRule ^rss/(.*) /modules/rss/$1 [QSA,L]
RewriteRule ^mapa-sajta/(.*) /modules/sitemap/$1 [QSA,L]
RewriteRule ^kontakt/(.*) /modules/liaise/$1 [QSA,L]
RewriteRule ^casopis/(.*) /modules/mastop_publish/$1 [QSA,L]
RewriteRule ^blog/(.*) /modules/planet/$1 [QSA,L]
RewriteRule ^tekstovi-glavna/(.*) /modules/tekstovinovo/$1 [QSA,L]

ErrorDocument 404 /404.html

---------------------------------------------------------------

Replace mysite & it must works !!!
HispaXoops | Xoops España

That's the way i like it! | Nada mejor que una Alhambra bien helada con aceitunas...

9
bjuti
Re: Canonical URI´s over Xoops
  • 2009/7/18 22:07

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


Tnx, it works now! :)

Now tell me.. is it possible to redirect www.mysite.com/index.php to only www.mysite.com? I've tired once, but navigation in news module didn't work..

Tnx again

10
DonCurioso
Re: Canonical URI´s over Xoops

bjuti,

add to your .htaccess:

redirect 301 /index.phphttp://www.yoursite.xyz

I think that's all... simply but effective


I feel it´s not possible because many modules have got an index.php

Maybe i´m on an error... maybe not.

Have luck !
HispaXoops | Xoops España

That's the way i like it! | Nada mejor que una Alhambra bien helada con aceitunas...

Login

Who's Online

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


Members: 0


Guests: 168


more...

Donat-O-Meter

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

Latest GitHub Commits