mani313 Posted July 5, 2013 Share Posted July 5, 2013 Hi there, i'm here to post my problem...i'm a newbie developer for prestashop Here is my probelem, Now my shop domainredirects to index.php page I want to redirect it to my own template page (for example About us page :: http://www.myshop.com/about_us.php) here is the clue : if entered ' http://myshop.com/ ' it should get redirect to 'http://myshop.com/about_us.php ' otherwise only if i entered ' http://myshop.com/index.php ' to should go to home page FYI , here is my sample own template code: <?php include(dirname(__FILE__).'/config/config.inc.php'); include(dirname(__FILE__).'/header.php'); // $smarty->display(_PS_THEME_DIR_.'newpage.tpl'); /** Getting Wordpress Content Here **/ $id=$_GET['p']; $link = mysql_connect(_DB_WP_SERVER_, _DB_WP_USER_, _DB_WP_PASSWD_); $dbSelect=mysql_select_db(_DB_WP_NAME_); $set=mysql_query("SELECT `post_content` FROM wp_posts WHERE ID='6'"); global $smarty; // $smarty->assign('cms_wp_pages_id','all_wp'); // $smarty->assign('cms_wp_pages', 1); ?> <!-- Start of Main Contents --> <div class="main"> <div class="col-main"> // about us contents goes here </div> </div> <!-- End of Main Contents --> <?php include(dirname(__FILE__).'/footer.php'); ?> I tried to do solve this using htaccess solution as 'domain redirection to (non index.php) index_2.php' yes it worked on other sites but not for prestashop.. here is the that htaccess solution code <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^myshop.com$ RewriteRule ^$ http://myshop.com/index_2.php [L,R=301] </IfModule> is there any ohther way to solve this? can you give me a solution ? thanx in adv Link to comment Share on other sites More sharing options...
PSfever.com Posted July 5, 2013 Share Posted July 5, 2013 I think there is another more simple solution. In the BackOffice, go to preferences, SEO & URL and set the website URL index to yourdomain.com/about_us.php Link to comment Share on other sites More sharing options...
mani313 Posted July 5, 2013 Author Share Posted July 5, 2013 Previous Page Next Page On 7/5/2013 at 8:59 AM, PSfever.com said: I think there is another more simple solution. In the BackOffice, go to preferences, SEO & URL and set the website URL index to yourdomain.com/about_us.php Are you mean Rewritten URL for index ? Previous Page Next Page Link to comment Share on other sites More sharing options...
vekia Posted July 5, 2013 Share Posted July 5, 2013 psfever - I tried but i've got this: Link to comment Share on other sites More sharing options...
PSfever.com Posted July 5, 2013 Share Posted July 5, 2013 Nope, scroll down there should be 3 fields Domain of SHOP SSL Domain of shop Basic URL. You can change the basic URL to /somefunction.php. So next time you type www.yourdomain.com, it should redirect you to www.yourdomain.com/somefunction.php Link to comment Share on other sites More sharing options...
mani313 Posted July 5, 2013 Author Share Posted July 5, 2013 and exactly i dont want redirect index.php to about_us.php...because after i cant access my shop i want to redirect my domain (for ex: http://mysite.com to http://mysite.com/about_us.php) Link to comment Share on other sites More sharing options...
mani313 Posted July 5, 2013 Author Share Posted July 5, 2013 On 7/5/2013 at 9:09 AM, PSfever.com said: Nope, scroll down there should be 3 fields Domain of SHOP SSL Domain of shop Basic URL. You can change the basic URL to /somefunction.php. So next time you type www.yourdomain.com, it should redirect you to www.yourdomain.com/somefunction.php Yes i tried ..but it redirect to htt://mysite.com/about_us.php/index.php i think we got almost close to soln..how to remove that index.php Link to comment Share on other sites More sharing options...
PSfever.com Posted July 5, 2013 Share Posted July 5, 2013 You wouldn't redirect index.php, but it would do the thing you want. This used to work in 1.4.X version, I remember setting the homepage on one of my clients websites to a certain category. Here it would be best to solve it simply by modifying .htaccess Rewritecond %{http_host} ^yourdomain.com [nc] Rewriterule ^(.*)$ http://www.yourdomain.com/whateverfunction.php [r=301,nc] Link to comment Share on other sites More sharing options...
mani313 Posted July 5, 2013 Author Share Posted July 5, 2013 On 7/5/2013 at 9:15 AM, PSfever.com said: You wouldn't redirect index.php, but it would do the thing you want. This used to work in 1.4.X version, I remember setting the homepage on one of my clients websites to a certain category. Here it would be best to solve it simply by modifying .htaccess Rewritecond %{http_host} ^yourdomain.com [nc] Rewriterule ^(.*)$ http://www.yourdomain.com/whateverfunction.php [r=301,nc] it tried it its not working ..i also tried similar earlier(see on my top post ) its working in normal site but not on prestashop.. Link to comment Share on other sites More sharing options...
PSfever.com Posted July 5, 2013 Share Posted July 5, 2013 Which .htaccess are you editing? Usually (from my experience) there is one on the same level as public folder. Prestashop is in the public folder. Don't edit this one, try the one that is "one level above". I know this sounds confusing, I dunno how to explain this differently. Link to comment Share on other sites More sharing options...
mani313 Posted July 5, 2013 Author Share Posted July 5, 2013 On 7/5/2013 at 9:30 AM, PSfever.com said: Which .htaccess are you editing? Usually (from my experience) there is one on the same level as public folder. Prestashop is in the public folder. Don't edit this one, try the one that is "one level above". I know this sounds confusing, I dunno how to explain this differently. one level up mean...where ? /home/username/public html/ prestashop files i tried to put inside username folder (i.e, one level up to shop) but not wrking..: Link to comment Share on other sites More sharing options...
PSfever.com Posted July 5, 2013 Share Posted July 5, 2013 There is one more thing I can think of. What about...you're webhoster doesn't allow redirecting? I've encountered this once so far, low probability of success but I can't see what went wrong... Link to comment Share on other sites More sharing options...
mani313 Posted July 5, 2013 Author Share Posted July 5, 2013 On 7/5/2013 at 9:43 AM, PSfever.com said: There is one more thing I can think of. What about...you're webhoster doesn't allow redirecting? I've encountered this once so far, low probability of success but I can't see what went wrong... Yes i'll ask to webhoster for this..can you guess why prestashop doesnt allow this htaccess method when its working fine on other sites? Link to comment Share on other sites More sharing options...
PSfever.com Posted July 5, 2013 Share Posted July 5, 2013 I sincerely can't. Sometimes it surprises me what is the cause of some of the problems I encounter...:-) Link to comment Share on other sites More sharing options...
mani313 Posted July 5, 2013 Author Share Posted July 5, 2013 On 7/5/2013 at 9:48 AM, PSfever.com said: I sincerely can't. Sometimes it surprises me what is the cause of some of the problems I encounter...:-) hm...is anyother solution like php redirection or 'purchased domain redirection' on cpanel tricks? Link to comment Share on other sites More sharing options...
PSfever.com Posted July 5, 2013 Share Posted July 5, 2013 Yes there are many ways, people tend to use .htaccess as it's the simplest one. Take a look here http://www.webconfs.com/how-to-redirect-a-webpage.php Link to comment Share on other sites More sharing options...
mani313 Posted July 5, 2013 Author Share Posted July 5, 2013 On 7/5/2013 at 9:53 AM, PSfever.com said: Yes there are many ways, people tend to use .htaccess as it's the simplest one. Take a look here http://www.webconfs....t-a-webpage.php Yes thanks for the link..i really need to redirect domain only , no need of page because , i cant access shop home page Link to comment Share on other sites More sharing options...
mani313 Posted July 5, 2013 Author Share Posted July 5, 2013 (edited) and finally i got it right... i added in DirectoryIndex mypage.php htaccess the powerful line working superb.. thanx for psfever Edited July 6, 2013 by mani313 (see edit history) 1 Link to comment Share on other sites More sharing options...
vekia Posted July 6, 2013 Share Posted July 6, 2013 so, the problem is solved so i can mark it as [solved] thanks for solutions here regards Link to comment Share on other sites More sharing options...
Recommended Posts