lei Posted June 2, 2010 Share Posted June 2, 2010 我把prestashop安装在/shop目录下 而非系统的根目录/。 由此带来的问题就是每次我都要输入www.mydomain/shop 进行访问,而不能通过www.mydomain直接进行访问。我尝试着把index 文件放到根目录下,并修改如下<?phpinclude(dirname(__FILE__).'/shop/config/config.inc.php');if(intval(Configuration::get('PS_REWRITING_SETTINGS')) === 1) $rewrited_url = __PS_BASE_URI__;include(dirname(__FILE__).'/shop/header.php');$smarty->assign('HOOK_HOME', Module::hookExec('home'));$smarty->display(_PS_THEME_DIR_.'index.tpl');include(dirname(__FILE__).'/shop/footer.php');?>可以显示还是不正常。 Link to comment Share on other sites More sharing options...
i978 Posted June 2, 2010 Share Posted June 2, 2010 我把prestashop安装在/shop目录下 而非系统的根目录/。 由此带来的问题就是每次我都要输入www.mydomain/shop 进行访问,而不能通过www.mydomain直接进行访问。我尝试着把index 文件放到根目录下,并修改如下<?phpinclude(dirname(__FILE__).'/shop/config/config.inc.php');if(intval(Configuration::get('PS_REWRITING_SETTINGS')) === 1) $rewrited_url = __PS_BASE_URI__;include(dirname(__FILE__).'/shop/header.php');$smarty->assign('HOOK_HOME', Module::hookExec('home'));$smarty->display(_PS_THEME_DIR_.'index.tpl');include(dirname(__FILE__).'/shop/footer.php');?>可以显示还是不正常。 通过修改.htacess文件,可以实现。 Link to comment Share on other sites More sharing options...
lei Posted June 2, 2010 Author Share Posted June 2, 2010 我把prestashop安装在/shop目录下 而非系统的根目录/。 由此带来的问题就是每次我都要输入www.mydomain/shop 进行访问,而不能通过www.mydomain直接进行访问。我尝试着把index 文件放到根目录下,并修改如下<?phpinclude(dirname(__FILE__).'/shop/config/config.inc.php');if(intval(Configuration::get('PS_REWRITING_SETTINGS')) === 1) $rewrited_url = __PS_BASE_URI__;include(dirname(__FILE__).'/shop/header.php');$smarty->assign('HOOK_HOME', Module::hookExec('home'));$smarty->display(_PS_THEME_DIR_.'index.tpl');include(dirname(__FILE__).'/shop/footer.php');?>可以显示还是不正常。 通过修改.htacess文件,可以实现。 可否告知具体如何修改比如我安装在了/shop/下. Link to comment Share on other sites More sharing options...
JINBAO Posted June 3, 2010 Share Posted June 3, 2010 不用这么麻烦的 你的空间是哪里买的?支持在线客服么? 去问他们 他们会告诉你一个很简单的方法我刚开始也是你这个情况 后来问了我的空间客服 他们就给了我一小段代码:<? header("Location: shop/") ?>文件名是“index.php” 然后上传到空间根目录就可以了 如果你不是上传到 mydomain/shop下面 就要把shop换成你相对应的目录不清楚这个是否也适用于你的空间 Link to comment Share on other sites More sharing options...
Guest Posted June 30, 2010 Share Posted June 30, 2010 可以修改.htaccess文件实现跳转 重定向 www.yoursite.com/shop 到 www.yoursite.com: RewriteEngine on (ONLY if it's not already there) RewriteCond %{HTTP_HOST} ^your_site.com/shop RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L] 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