xoops forums

blackrx

Quite a regular
Posted on: 2010/3/16 1:24
blackrx
blackrx (Show more)
Quite a regular
Posts: 227
Since: 2008/2/5 1
#1

How do i redirect an old xoops page to main page ?

this old link of my site is still exist in search engine
and when you go to this url you will see blank page
what is worse is

it appears on top of the search result


i don't use the content module anymore


mysite.com/modules/content/print.php?id=32
mysite.com/modules/content/print.php?id=34
mysite.com/modules/content/print.php?id=38


how do i redirect the url above to my main page with htaccess ?

or maybe there is other way

Peekay

XOOPS is my life!
Posted on: 2010/3/16 2:43
Peekay
Peekay (Show more)
XOOPS is my life!
Posts: 2335
Since: 2004/11/20
#2

Re: How do i redirect an old xoops page to main page ?

You can try

RewriteEngine on 
RewriteCond 
%{QUERY_STRING} ^id
RewriteRule 
^/modules/content/print.phphttp://www.mysite.com [L,R=301]


But it's late and I am heading for bed, so you might want to see what others recommend!

blackrx

Quite a regular
Posted on: 2010/3/16 6:22
blackrx
blackrx (Show more)
Quite a regular
Posts: 227
Since: 2008/2/5 1
#3

Re: How do i redirect an old xoops page to main page ?

thank you peekay

but its not working

Peekay

XOOPS is my life!
Posted on: 2010/3/16 11:42
Peekay
Peekay (Show more)
XOOPS is my life!
Posts: 2335
Since: 2004/11/20
#4

Re: How do i redirect an old xoops page to main page ?

Apache Mod Rewrite needs to be enabled on your server which is not always the case. To test:

rewriteEngine on
rewriteRule 
^noexist.htmlhttp://www.mysite.com/doesexist.html [L]


Upload 'doesexist.html', request the page 'noexist.html' in your browser and you should be redirected.

If that doesn't work, try adding the 'symlinks' line, e.g.

Options +FollowSymLinks
rewriteEngine on
rewriteRule 
^noexist.htmlhttp://www.mysite.com/doesexist.html [L]

sailjapan

Moderator
Posted on: 2010/3/16 12:54
sailjapan
sailjapan (Show more)
Moderator
Posts: 1672
Since: 2005/11/16
#5

Re: How do i redirect an old xoops page to main page ?

If your host provides you with CPanel, there's a redirect function there that's easy to use.

blackrx

Quite a regular
Posted on: 2010/5/1 13:59
blackrx
blackrx (Show more)
Quite a regular
Posts: 227
Since: 2008/2/5 1
#6

Re: How do i redirect an old xoops page to main page ?

yes i use cpanel redirection and its working...thanks