I have some pages calling news module with instruction like:
Code: Select all
{news category="General" summarytemplate="Responsive_News_Summary" detailtemplate="Responsive_News_Detail"}
Code: Select all
http://www.mysite.com/news/333/222/mynewstitle/d,Responsive_News_Detail.htm
Code: Select all
http://www.mysite.com/news/333/222/mynewstitle.htm
One option is to edit .htaccess and create a 301 redirect but not all webmasters can access to it.
So here my CMSMS solution:
- Clone actual news detail template with a new name and make it default template.
- Create a new UDT named "moved301" with this code
Code: Select all
$url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $path = parse_url($url, PHP_URL_PATH); $pathComponents = explode("/", trim($path, "/")); $newurl = 'http://'.$_SERVER['HTTP_HOST']. '/'. $pathComponents[0] .'/'.$pathComponents[1] .'/'.$pathComponents[2] .'/'.$pathComponents[3] .'.htm'; header("HTTP/1.1 301 Moved Permanently"); header("Location: $newurl");
- Edit old template and remove all content (but don't delete template) replacing with {moved301}
- Done!
Hope it helps
Regards
blast