301 Redirect to Canonical URL (url_check.php)

Permalink
I noticed that redirects to BASE_URL are done with a 302, but a 301 is preferred by most, if not all search engines.

http://www.tdcreative.net/blog/the-only-safe-seo-redirect/...
http://www.theinternetdigest.net/archive/301-redirects-seo.html...

I added one line to url_check.php to put to HTTP Status 301 instead of the default 302.

I have two questions:

(1) How does one go about requesting changes to concrete5 via contributions?

(2) What is the "best practices" way for me to modify the core without touching the core files? I tried creating a new "startup" folder in the root to house the modified url_check.php since the original file lives in /concrete/startup, but the change did not override the original.

<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
if (REDIRECT_TO_BASE_URL == true && (BASE_URL != 'http://' . $_SERVER['HTTP_HOST']) && (BASE_URL . ':' . $_SERVER['SERVER_PORT'] != 'http://' . $_SERVER['HTTP_HOST'])) {
    header("HTTP/1.1 301 Moved Permanently");
    header('Location: ' . BASE_URL . $_SERVER['REQUEST_URI']);
    exit;
}


Thanks,
Jim

jbernat
 
jbernat replied on at Permalink Reply
jbernat
I found the answer to (1) above and posted a patch for consideration:http://www.concrete5.org/community/bugs/patch_301_redirect_in_url_c...

Still interested in hearing about question (2).

Thanks,
Jim
focus43 replied on at Permalink Reply
focus43
Thanks for that amigo.
Mnkras replied on at Permalink Reply
Mnkras
tea, for the startup folder that can't be modified out of the core as it kinda looks there and only there