Jump to content

[solved] Shop domain Should Redirect to another page instead of home


Recommended Posts

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

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

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

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

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

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

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

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

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

×
×
  • Create New...