Page 1 of 1

Google, and URL redirects

Posted: Mon 15. Nov 2004, 00:14
by davidsuk
Hello folks, a couple of questions about Google and PHPWCMS:

PHPWCMS is installed at: http://www.treatthepeople.com/phpwmcs/ so my start page is http://www.treatthepeople.com/phpwmcs/index.php . Obviously, when I give people the address for my site, I don't give them that, I just give them "www.treatthepeople.com" then I have an index.html file in the root that reads:
:<HTML LANG=en-CA>
<HEAD>
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.treatthepeople.com/phpwmcs/index.php">
<META NAME="ROBOTS" CONTENT="NOINDEX, FOLLOW">
</head>
</html>
Google ranks pages by how many links around the WWW link to your page (and how highly ranked those pages are). Most links on the web are to treatthepeople.com, not to treatthepeople.com/phpwmcs/index.php. So what will happen? will the page stay ranked low even if many pages link to the treatthepeople.com address? Or will google count links to treatthepeople.com as links to /phpwmcs/index.php?

Furthermore, within that site, there are a number of "chapter site" - that is, pages for local chapters of the organization. Each of these chapters has a website something like http://www.treatthepeople.com/phpwmcs/index.php?mgac . but is given a simple address too - http://www.treatthepeople.com/mgac (in the mgac folder there is a index.html file that links to the real address) So same question here: if there are links around the net linking to http://www.treatthepeople.com/mgac , will that improve the mgac page google ranking?

Are there alternative ways organize a site ensuring high rankings, and accessibility in the form of an easy URL?

thanks, David

Posted: Tue 30. Nov 2004, 15:45
by spirelli
I am having the exact same issue and would also like to hear answers to the questions above. I also give people or other websites links like http://www.domain.com/category that redirect to http://www.domain.com/category.phtml

Re: Google, and URL redirects

Posted: Fri 3. Dec 2004, 03:58
by Povijest
davidsuk wrote: PHPWCMS is installed at: http://www.treatthepeople.com/phpwmcs/ so my start page
.. cut ..

How do you get that shadow around your page???

htaccess redirect

Posted: Mon 20. Dec 2004, 08:49
by fnord
spirelli wrote:I am having the exact same issue and would also like to hear answers to the questions above. I also give people or other websites links like http://www.domain.com/category that redirect to http://www.domain.com/category.phtml
I think you should be able to accomplish exactly what you want with an .htaccess redirect.

1. Grab your .htaccess file from the place the www docs are stored on your server (or create a blank text file if one doesn't exist.)

2. Add a line like this:

Code: Select all

redirect 301 /category http://www.mydomain.com/category.phtml
3. Put the .htaccess file back on the server.

You should find that if a user types in the "http://www.mydomain.com/category" it takes them right to the phtml file. Search engines are supposed to respect this redirect as a "permanently moved file" so they should show the category.phtml next time they re-index your site.

I'm handling a large redesign of a site where many files have moved in this way. So far, so good on my testing but I have to wait for all the search engines to update to be sure. I'll keep you posted if I come across any big problems but so far this is MUCH cleaner and faster than using html forwards everywhere.

Enjoy-

Fnord

Posted: Tue 21. Dec 2004, 22:14
by Igor
This redirect instruction in the .htaccess file doesn't work on my site. :( I use http://www.paffen.nl/verzekeringen where http://www.paffen.nl/verzekeringen.phtml is an existing category.

What is wrong?

Posted: Wed 22. Dec 2004, 03:39
by fnord
Igor wrote:This redirect instruction in the .htaccess file doesn't work on my site. :( I use http://www.paffen.nl/verzekeringen where http://www.paffen.nl/verzekeringen.phtml is an existing category.

What is wrong?
Try adding a "/" after the "directory" entry like this:

Code: Select all

redirect 301 /testing45/ http://www.mysite.org/file.phtml
That should do the trick. I just tested it and it works for me.

Fnord

Posted: Wed 22. Dec 2004, 09:46
by Igor
Didn't help... :(

Posted: Wed 22. Dec 2004, 16:48
by fnord
Odd...it should work. Can you post your entire .htaccess file? Are other commands in your .htaccess file working properly? Do you have your .htaccess file in the "root" web directory?

Posted: Wed 22. Dec 2004, 22:57
by Igor
OK, here it is. It's the standard file, with only some little changes. The rewrite works good.

Code: Select all

# These settings are recommend
# Maybe you might have problems
# with other scripts that needs
# register_globals ON
php_flag magic_quotes_gpc Off
php_flag register_globals Off


# Rewrite functionality for phpwcms
# optimized by Jan212
# 18-04-2004

# Check that you have set Options FollowSymLinks
# and right Allow
RewriteEngine On

# maybe you need this
DirectoryIndex index.html index.php 


# Default ReWrite settings for phpwcms
# ===============================================
# This will rewrite 0.0.0.0.0.0.phtml => index.php?id=0.0.0.0.0.0
RewriteRule ^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.phtml$ index.php?id=$1.$2.$3.$4.$5.$6

# This will rewrite mypage.phtml => index.php?mypage
RewriteRule ^(.+)\.phtml$ index.php?$1


# If phpwcms is installed in a subdirectory,
# sample: "mysubdir" then use this (remove #)
# if above lines doesn't work for you
# ===============================================
#RewriteBase /mysubdir
#RewriteRule ^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.phtml$ /mysubdir/index.php?id=$1.$2.$3.$4.$5.$6
#RewriteRule ^(.+)\.phtml$ /mysubdir/index.php?$1 


# If you want to set rewrite logging
# ===============================================
#RewriteLog "/absolute/path/to/the/rewrite.log" 
# 0 = Logging disabled, 9 = highest level of logging, only for debugging 
#RewriteLogLevel 3

redirect 301 /verzekeringen/ http://www.paffen.nl/verzekeringen.phtml
By the way. On my other phpwcms site (other provider) I can use URL's like http://www.mysite.com/?category to go to the mentioned category page. The redirect line you suggested isn't added in the .htaccess file. When I add it, your method doesn't work. The ?-method still works.

Strange...