lime Posted September 2, 2011 Share Posted September 2, 2011 Hi all, In the theme I'm using, my "category.php?id_category=1" page looks awful. I'm using an image fader on the home page and it doesn't show in category=1. Anyway, I don't actually want the category=1 (home>home) page to even show, so I'm looking for an easy hack to redirect "category.php?id_category=1" to the actual home page of the site. Maybe by modifying the Home link in the menu? Any help with this greatly appreciated. Link to comment Share on other sites More sharing options...
lime Posted September 4, 2011 Author Share Posted September 4, 2011 Solved it with a small change to CategoryController.php (PS v1.4.4.1) Inserted the following line between line 94 an 95: if ($id_category == "1") header("Location: http://SHOPHOME"); SHOPHOME being the address of my home page. Apologies to any real coders out there if this is bad php, but it appears to do the job :-) Link to comment Share on other sites More sharing options...
Jasen Posted November 7, 2011 Share Posted November 7, 2011 This is exactly what I'm looking for but when I put that code in, it gives me an internal 500 error. Link to comment Share on other sites More sharing options...
Jasen Posted November 7, 2011 Share Posted November 7, 2011 Never mind I got it! Adding the code right after the following on lines 88[spam-filter] worked for me. if (!($id_category = (int)Tools::getValue('id_category')) OR !Validate::isUnsignedId($id_category)) $this->errors[] = Tools::displayError('Missing category ID'); else { Link to comment Share on other sites More sharing options...
Rita DIn Posted December 2, 2011 Share Posted December 2, 2011 SUper!!!! thank you! Link to comment Share on other sites More sharing options...
Mr S Posted January 12, 2012 Share Posted January 12, 2012 Here is what i use: ................. else { if((int)$this->category->id == 1) { $shopUrl = Tools::getShopDomain(true).__PS_BASE_URI__; header('HTTP/1.1 301 Moved Permanently'); header('Location: '. $shopUrl); exit(); } ................. Link to comment Share on other sites More sharing options...
MarioDJNaro Posted September 21, 2012 Share Posted September 21, 2012 (edited) Here is what i use: ................. else { if((int)$this->category->id == 1) { $shopUrl = Tools::getShopDomain(true).__PS_BASE_URI__; header('HTTP/1.1 301 Moved Permanently'); header('Location: '. $shopUrl); exit(); } ................. Where I must put this code? can you say me some line before this?? Edited September 21, 2012 by MarioDJNaro (see edit history) Link to comment Share on other sites More sharing options...
www.dressmeglam.com Posted October 1, 2012 Share Posted October 1, 2012 Where I must put this code? can you say me some line before this?? Here is what i use: ................. else { if((int)$this->category->id == 1) { $shopUrl = Tools::getShopDomain(true).__PS_BASE_URI__; header('HTTP/1.1 301 Moved Permanently'); header('Location: '. $shopUrl); exit(); } ................. Here is what i use: ................. else { if((int)$this->category->id == 1) { $shopUrl = Tools::getShopDomain(true).__PS_BASE_URI__; header('HTTP/1.1 301 Moved Permanently'); header('Location: '. $shopUrl); exit(); } ................. please tell us where to insert this code Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now