internal pretty urls and search engine best practices

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
davids355
Power Poster
Power Poster
Posts: 279
Joined: Fri Apr 04, 2008 10:08 am
Location: UK

internal pretty urls and search engine best practices

Post by davids355 »

Hi,

firstly hope this is in the right place (couldnt work out the best section to post in).

I am using cmsmadesimple 1.6.3

I have recently turned on pretty urls (internal)
(in config.php: $config['url_rewriting'] = 'internal';)

Since this has changed all my urls, I spent AGES yesterday updating my .htaccess file to redirect all my old urls to new.,..

Just found out today that this doesnt work with dynamic urls!!!

So, as far as SEO is concerned what should I do to let Google and or visitors know that I have changed url structure? - otherwise it will seem like I have two pages for everything:
index.php?page=porvair
index.php/porvair.html
etc

any help much appreciated.
viebig

Re: internal pretty urls and search engine best practices

Post by viebig »

you can use robots.txt to prevent access to index.php? or even do it directly in htaccess , note that there is modules that support pretty urs and modules that dont.

Regards
Hereistos
Forum Members
Forum Members
Posts: 29
Joined: Sat Apr 11, 2009 12:42 am

Re: internal pretty urls and search engine best practices

Post by Hereistos »

don't do that ...
just redirect to the correct url and send the correct status code 302

http://en.wikipedia.org/wiki/HTTP_302
davids355
Power Poster
Power Poster
Posts: 279
Joined: Fri Apr 04, 2008 10:08 am
Location: UK

Re: internal pretty urls and search engine best practices

Post by davids355 »

so if im going from here:
index.php?page=porvair

to here:
index.php/porvair.html

how do i do that Hereistos?
Pierre M.

Re: internal pretty urls and search engine best practices

Post by Pierre M. »

Hello,

if you care that much about pretty urls you should try to have
/abc.html
instead of
/index.php/abc.html
this is done by using mod_rewrite and the documentation explains how to do.

If you have "publicly exposed" ugly urls you can send 301 rewrite rules also. This is a separate issue, you can add these rules before the pretty ones.

Please search the forum for 301 and htaccess.

Pierre M.
viebig

Re: internal pretty urls and search engine best practices

Post by viebig »

Hereistos wrote: don't do that ...
just redirect to the correct url and send the correct status code 302

http://en.wikipedia.org/wiki/HTTP_302
301 is the right option. Plan your site, and set everything right before publishing it.
davids355
Power Poster
Power Poster
Posts: 279
Joined: Fri Apr 04, 2008 10:08 am
Location: UK

Re: internal pretty urls and search engine best practices

Post by davids355 »

This is what I have done. Tell me if this will do because Im struggling here!!

Bare in mind that I just want to make sure google realises that the old urls have moved to the new.

So in .htaccess:
RewriteCond %{query_string} page=register
RewriteRule (/)?$ http://www.shareworld.co.uk/index.php/f ... ister.html? [R=301,L]

If you goto:
http://www.shareworld.co.uk/index.php?page=register
it will forward you to
http://www.shareworld.co.uk/index.php/f ... ister.html

Im sure theres some wildcard method of doing this globally, but couldnt work it out so I have done this for every important url that I know Google has a record of. Will this do?
viebig

Re: internal pretty urls and search engine best practices

Post by viebig »

yes this is perfect!
Post Reply

Return to “CMSMS Core”