Forum Moderators: phranque

Message Too Old, No Replies

Most appropriate rule to keep my Google indexing

dotclear rewriting rule query string path info

         

Blogstory

6:26 pm on Mar 17, 2008 (gmt 0)

10+ Year Member



I would like to know which .htaccess rule is the most appropriate to make actual URLs in query_sting TO new URLs in path_info to keep at the same time my good Google indexation?

My blog (Dotclear platform) URLs stand like this for now :

http://www.example.com/blogstory/?2008/03/12/707-montreal-dans-sa-bulle-hivernale

but I would like URLs like this :

http://www.example.com/blogstory/2008/03/12/707-montreal-dans-sa-bulle-hivernale

OR like this :

http://www.example.com/blogstory/montreal-dans-sa-bulle-hivernale

I would like to know both rules but I will use only one.

Tanks a lot for your time.
Frank

[edited by: jdMorgan at 9:30 pm (utc) on Mar. 17, 2008]
[edit reason] No personal URLs, please. See Terms of Service. [/edit]

g1smd

11:03 pm on Mar 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The URL format you want to use must feature in the links on the page within the site.

The rewrite rule then connects that URL with the correct internal server path and filename.

You'll also need a redirect from the old URL to the new URL to stop the unwanted URL being indexed as Duplicate Content.

You must also validate the keyword-text part of the URL against your database post title entries to stop people assigning any old title they want, in external links, and ruining your indexing.

Blogstory

1:12 am on Mar 18, 2008 (gmt 0)

10+ Year Member



Sorry for my personnal url...

I can change the URL format to path info in my blog admin interface.
No problem with that.

But I am clueless regarding the rewrite and the redirect rules.

What do you mean by validate the keyword-text?

g1smd

2:41 am on Mar 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Your post has a URL like...

www.example.com/blogstory/2008/03/12/707-montreal-dans-sa-bulle-hivernale

...where the date and the "707" are used to pull the required data from the database, but the following words are just keywords to stuff the URL.

If the blog script does not compare those words with the real title of the post, then I can link to your article as...

www.example.com/blogstory/2008/03/12/707-this-article-is-complete-junk

...and the article will be indexed with that URL too. That's Duplicate Content and will be a big problem for you.

Imagine someone "created" 50 URLs for every page of your site in this way. See the problem yet?

Validate the words in the request, and send a 404 or a 301 if they do not match.

Blogstory

1:06 pm on Mar 18, 2008 (gmt 0)

10+ Year Member



Here is the rule I tried. Seems to work. Do you see any problems with that rule anyway? g1smd, for your information, the numer 707 in the previous exemple is a unique identifier that will not come back in any url of my blog because dotclear increment it at each new post.
So url will not look the same even with an identical post title.

imagine this is my 707e post :
www.example.com/blogstory/2008/03/12/707-this-article-is-complete-junk

and this is the 708e post :
www.example.com/blogstory/2008/03/12/708-this-article-is-complete-junk

My rule :

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /blogstory/index.php/$1
RewriteRule ^index.php$ blogstory/index.php/

RewriteCond %{QUERY_STRING} ^type=co$
RewriteRule ^rss\.php$ blogstory [NC,L,R=301]
RewriteRule ^atom\.php$ blogstory [NC,L,R=301]

RewriteRule ^atom\.php blogstory [NC,L,R=301]
RewriteRule ^rss\.php blogstory [NC,L,R=301]

# Permit rewriting of index.php?/year/month/day/uniquenumber-post-title for dotclear1
RewriteCond %{QUERY_STRING} ^([0-9]{4}/[0-9]{2}/[0-9]{2}/[0-9]+.*)$
RewriteRule ^index.php [exemple.com...] [R,L]

g1smd

11:51 pm on Mar 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The [R] gives you a redirect.

I thought you wanted a rewrite. In fact it gives you a 302 Redirect - and that would be a bad move.

By the way, all redirect code must be placed before any rewrite code, so that you do not expose internal filenames to the browser.

Blogstory

11:14 am on Mar 19, 2008 (gmt 0)

10+ Year Member



Well g1smd, go back to the first post of this thread and give me an answer regarding it. I dont know if a rewrite or a redirect is best for me. And even if I know that I dont know how to write the rule.

Blogstory

4:23 pm on Mar 24, 2008 (gmt 0)

10+ Year Member



I am still need a functionnal rule for my website. Thanks