Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
SEO trick (for developers)
S
✭✭
For example, news. Just example, no explanations
Example:
Example:
// class.newsconttroller.php // file
// public function Index($Code) {
if (is_numeric($Code)) {
$this->View($Code);
}
// elseif(... other check for news category url code, etc.
}
...
// public function View() { // method
...
// trick
$NewsModel = Gdn_NewsModel();
$Story = $NewsModel->GetID($NewsID);
...
$NewsStoryURL = 'news/'.$Story->NewsID.'/'.Gdn_Format::Url($News->Title); // or you can use Clean() method
$CanonicalUrl = $this->CanonicalUrl(Url($NewsStoryURL, True));
if ($NewsStoryURL != $this->SelfUrl) Redirect($CanonicalUrl, 301);
...
Tagged:
0
Comments
There was an error rendering this rich post.
www.oreeka.co.uk
We can provide any original contents to bind url in this way within Garden framework, right?
I'll try it out later.
There was an error rendering this rich post.
Thanks @Lincoln!
I posted, sleeped and woke up. Now I'm back in here and read this before to start coding.
It's my lucky day.