1
tatane
redirection 301 .htaccess
  • 2009/2/10 18:26

  • tatane

  • Just can't stay away

  • Posts: 649

  • Since: 2008/5/6 1



hello

I just redirect my addresses through smarty-plugin-xoRewriteModule. Only now, I want to make 301 redirect via htaccess of the old formatshttp://www.monsite.com/module/catads url link to the newhttp://www.monsite.com/petites-annonces-sarthe /

How?

thank you

2
tatane
Re: redirection 301 .htaccess
  • 2009/2/11 11:23

  • tatane

  • Just can't stay away

  • Posts: 649

  • Since: 2008/5/6 1


I will specify


I have a site that runs on XOOPS 2.0.18.2 based on a 60 gp to ovh

Thanks to xoRewriteModule plugins I have changed my address on my site such as:

front:http://www.monsite.com/modules/catads/
Now:http://www.monsite.com/Petites_annonces_sarthe/

To do this, I put in a folder. Htaccess this
#Xoops : Start xoRewriteModule
RewriteEngine on

RewriteRule 
^actualite-handicap-sante/(.*)$ modules/news/$[L]
RewriteRule ^forum/(.*)$ modules/newbbex/$[L]
RewriteRule ^telechargement/(.*)$ modules/mydownloads/$[L]
RewriteRule ^partenaires/(.*)$ modules/smartpartner/$[L]
RewriteRule ^plan_du_site/(.*)$ modules/sitemap/$[L]
RewriteRule ^contact/(.*)$ modules/formulaire/$[L]
RewriteRule ^remerciement/(.*)$ modules/xfguestbook/$[L]
RewriteRule ^stats/(.*)$ modules/myReferer/$[L]
RewriteRule ^annonces/(.*)$ modules/catads/$[L]
RewriteRule ^message_prive/(.*)$ modules/mpmanager/$[L]
RewriteRule ^Temoignage/(.*)$ modules/userpage/$[L]
RewriteRule ^galerie_photo/(.*)$ modules/myalbum/$[L]
RewriteRule ^Contact/(.*)$ modules/contact/$[L]

#Xoops : End xoRewriteModule


Only if I typehttp://www.monsite.com/modules/catads/ I have access to this address as I should land onhttp://www.monsite.com/Petites_annonces_sarthe/

so I added in. htaccess, the line
[code] RewriteRule modules / Catadshttp://www.monsite.com/Petites_annonces_sarthe [R = 301] [/ code]

but the coup I could access the page!

thank you for your help

3
zyspec
Re: redirection 301 .htaccess
  • 2009/2/11 14:51

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


I think what you want is to use the RedirectMatch directive instead of just a RewriteRule. Something like:

RedirectMatch 301 ^/modules/catads/(.*)$ http://www.monsite.com/Petites_annonces_sarthe/$1


Of course, make sure it's all on one line

4
tatane
Re: redirection 301 .htaccess
  • 2009/2/11 15:42

  • tatane

  • Just can't stay away

  • Posts: 649

  • Since: 2008/5/6 1



I tried but it does not

5
elsanto
Re: redirection 301 .htaccess
  • 2009/2/11 17:43

  • elsanto

  • Just popping in

  • Posts: 18

  • Since: 2009/1/5 1



insert a file in index.phphttp://www.monsite.com/modules/catads

with the following code

<?php

header
("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.monsite.com/petites-annonces-sarthe "); exit;

?>



See an example in this url
http://www.guiasexo.com.ar/modules/googlemaps

redirect tohttp://www.guiasexo.com.ar/modules/mapagatero

Sorry for my English

6
zyspec
Re: redirection 301 .htaccess
  • 2009/2/11 19:10

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


elsanto I think that will just redirect anything to the index.php file, not anything in the directory.

Maybe this would do it:
RewriteRule /modules/catads/(.*)$ http://www.monsite.com/Petites_annonces_sarthe/$1 [R=301,L]


If that doesn't work I'd recommend you just use google search to find the right syntax for the .htaccess 301 redirect. I'm sure you can find the solution on the web.

7
tatane
Re: redirection 301 .htaccess
  • 2009/2/12 8:31

  • tatane

  • Just can't stay away

  • Posts: 649

  • Since: 2008/5/6 1



In modules / Catads / index.php I added

Quote:
header ( "HTTP/1.1 301 Moved Permanently" ); header ( "Location:http://www.les-petites-annonces-sarthoises.com/Petites_annonces_sarthe " ); exit;



With this change, if I type
http://www.monsite.com/petites-annonces-sarthe I arrive on a page Quote:
« Not Found The requested URL /petites-annonces-sarthe was not found on this server


For if I tape againsthttp://www.monsite.com/modules/catads
I am wellhttp://www.monsite.com/petites-annonces-sarthe course but with a page
Quote:
« Not Found The requested URL /petites-annonces-sarthe was not found on this server
!!!!!!

8
elsanto
Re: redirection 301 .htaccess
  • 2009/2/12 11:57

  • elsanto

  • Just popping in

  • Posts: 18

  • Since: 2009/1/5 1


Please check it .htaccess
it is currently not possible to
http://www.monsite.com/
No web site is configured at this address.

9
tatane
Re: redirection 301 .htaccess
  • 2009/2/12 12:09

  • tatane

  • Just can't stay away

  • Posts: 649

  • Since: 2008/5/6 1


here my .htaccess
Quote:

#Xoops : Start xoRewriteModule
RewriteEngine on

RewriteRule ^actualite/(.*)$ modules/news/$1 [L]
RewriteRule ^forum/(.*)$ modules/newbbex/$1 [L]
RewriteRule ^telechargement/(.*)$ modules/mydownloads/$1 [L]
RewriteRule ^partenaires/(.*)$ modules/smartpartner/$1 [L]
RewriteRule ^plandusite/(.*)$ modules/sitemap/$1 [L]
RewriteRule ^contact/(.*)$ modules/formulaire/$1 [L]
RewriteRule ^remerciement/(.*)$ modules/xfguestbook/$1 [L]
RewriteRule ^stats/(.*)$ modules/myReferer/$1 [L]
RewriteRule ^Petites_annonces_sarthe/(.*)$ modules/catads/$1 [L]
RewriteRule ^message_prive/(.*)$ modules/mpmanager/$1 [L]
RewriteRule ^Temoignage/(.*)$ modules/userpage/$1 [L]
RewriteRule ^Galerie_photo/(.*)$ modules/myalbum/$1 [L]
RewriteRule ^Contact/(.*)$ modules/contact/$1 [L]
RewriteRule ^Les_bonnes_affaires/(.*)$ modules/pages/$1 [L]

#Xoops : End xoRewriteModule

10
elsanto
Re: redirection 301 .htaccess
  • 2009/2/12 12:59

  • elsanto

  • Just popping in

  • Posts: 18

  • Since: 2009/1/5 1



Login

Who's Online

250 user(s) are online (128 user(s) are browsing Support Forums)


Members: 0


Guests: 250


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