Page 1 of 1

Google friendly "redirect" from Home [Update]

Posted: Mon 20. Mar 2006, 13:50
by flip-flop
redirect to: 301 Moved Permanently / 302 Moved Temporarily

Hi at all,

at site structure the first entry home don´t allow a "redirect to".
If you need a redirection at this point you do it at the article structure like "index.php?my_new_home".
The consequence are an Header request by the webserver like "302 Move Temporarily".
Google don´t like this. Your site would not become a good rank.
------------------------
A short and quick Workaround:
1. Create a new template named Redirect_Home.
2. At the section html head please insert:

Code: Select all

[PHP]
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: index.php?my_new_home" );
exit;
[/PHP]
3. At the site structure Home switch the template to Redirect_Home.
4. At article structure in Home-Article delete the redirect to: entry.
------------------------
That´s all.
A Google-friendly Header request "301 Moved Permanently" is provided.

If you have activated mod_rewrite: Header( "Location: my_new_home.phtml" );

Everyone an other idea? :idea:

You can test your site at http://web-sniffer.net

------------------------------------------------------------------
[Solved] since the "revised release of phpwcms" V1.2.6 date 27.04.2006.
It is implemented.

http://www.phpwcms.de/forum/viewtopic.php?p=64129#64129
------------------------------------------------------------------

Gruß Knut

Re: Google friendly "redirect" from Home

Posted: Thu 13. Apr 2006, 11:48
by rushclub
flip-flop wrote:You can test your site at http://web-sniffer.net
i get this code from web-sniffer:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.licht-harmonie.de/cms/">here</a>.</p>
</body></html>
so everything seems to be fine. or am i missing something. i havent change anything. used forwarding via phpwcms.

rush

Posted: Thu 13. Apr 2006, 12:03
by flip-flop
Yes, a very good result.
used forwarding via phpwcms
In what way you have do it via phpWCMS????

Code: Select all

root     (licht-harmonie.de)
-- CMS  (licht-harmonie.de/CMS/)
-- phpWCMS-root  (licht-harmonie.de/CMS/)
I don´t understand. A permanently redirect at your hosters config menue?

Gruß Knut

Posted: Thu 13. Apr 2006, 12:24
by rushclub
flip-flop wrote:Yes, a very good result.
used forwarding via phpwcms
In what way you have do it via phpWCMS????

Code: Select all

root     (licht-harmonie.de)
-- CMS  (licht-harmonie.de/CMS/)
-- phpWCMS-root  (licht-harmonie.de/CMS/)
I don´t understand. A permanently redirect at your hosters config menue?

Gruß Knut
i have a forwarding in the homedirectory to the folder "de". there is also an folder "en" so the homefolder has no content but a forwarding. a solution where i can set the forwarding sidewide to the reight setting - thats what i realy need. is there a solution?

rush

Posted: Thu 13. Apr 2006, 14:03
by flip-flop
How did you forward from "/" to "/CMS/"?

Gruß Knut

Posted: Thu 13. Apr 2006, 14:46
by rushclub
with

Code: Select all

<meta http-equiv="refresh" content="0;URL=cms/index.php">
is that the wrong solution?

cheers
rush

Posted: Thu 13. Apr 2006, 15:11
by flip-flop

Posted: Thu 13. Apr 2006, 22:00
by DeXXus
rushclub wrote:with

Code: Select all

<meta http-equiv="refresh" content="0;URL=cms/index.php">
is that the wrong solution?

cheers
rush
What most people seem to not realize, is that the http-equiv attribute is just a way to specify HTTP headers in a meta tag. This is handy when you want to do so in static pages, but PHP has the more "proper" way to specify headers: http://www.php.net/header. This creates a real HTTP header.

Redirection (whether at Server-level or with PHP header) is recommended, more often, as "best" method:
http://www.w3.org/QA/Tips/reback

BTW, I've always ~assumed~ this format to be more correct than yours:
<meta http-equiv="refresh" content="0;URL=/cms/index.php">
anyone know if it makes a difference?

Posted: Fri 28. Apr 2006, 08:24
by flip-flop
Hi folks!

[SOLVED]

we don´t use this any more since the "revised release of phpwcms" V1.26 date 27.04.2006.
It is implemented.

http://www.phpwcms.de/forum/viewtopic.php?p=64129#64129

Thanks Knut :D