spirales Posted July 3, 2013 Share Posted July 3, 2013 Hello, I have PrestaShop 1.5.4.1 in a sub-directory ("/prestashop") and I want to use it as root directory, so I can have URLs as "www.mysite.com/category/product" I added this .htaccess in the root folder # Copy and paste the following code into the .htaccess file # in the public_html folder of your hosting account # make the changes to the file according to the instructions. # Do not change this line - RewriteEngine on RewriteEngine on # Change yourdomain.com to be your main domain. RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$ # Change 'subfolder' to be the folder you will use for your main domain. RewriteCond %{REQUEST_URI} !^/prestashop/ # Don't change this line. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Change 'subfolder' to be the folder you will use for your main domain. RewriteRule ^(.*)$ /prestashop/$1 # Change yourdomain.com to be your main domain again. # Change 'subfolder' to be the folder you will use for your main domain # followed by / then the main file for your site, index.php, index.html, etc. RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$ RewriteRule ^(/)?$ prestashop/index.php [L] and set the Base URI to "/" in the SEO preferences It seems to work. URLs are ok. But there are some problems in the back office. For example: green save buttons don't work, but save grey input buttons work properly. For example: when I search for a module, quick results don't appear, I have to click on the Search button. All asynchronous calls seem to not work. How to solve? Link to comment Share on other sites More sharing options...
spirales Posted July 6, 2013 Author Share Posted July 6, 2013 (edited) The problem is that there are not jQuery-includes in the head tag When I set /prestashop/ as Base URI, everything is ok When I set / as Base URI, all jQuery-related includes disappear Please help me Edited July 6, 2013 by spirales (see edit history) Link to comment Share on other sites More sharing options...
spirales Posted July 7, 2013 Author Share Posted July 7, 2013 File: classes/Media.php Methods: - getCSSPath - getJSPath If I comment these lines if (Context::getContext()->controller->controller_type == 'admin') { $js_uri = preg_replace('/^'.preg_quote(__PS_BASE_URI__, '/').'/', '/', $js_uri); $js_uri = dirname(preg_replace('/\?.+$/', '', $_SERVER['REQUEST_URI']).'a').'/..'.$js_uri; } everything is ok the question is, it's a bug or a workaround for a bad way to configure PrestaShop as root? Link to comment Share on other sites More sharing options...
vekia Posted July 7, 2013 Share Posted July 7, 2013 you said that you changed the base uri to "/" so my question is: have you got your prestashop files in your root directory? Link to comment Share on other sites More sharing options...
spirales Posted July 7, 2013 Author Share Posted July 7, 2013 My goal is to have Prestashop in a subfolder, but with URLs such as www.foo.com/category/product I installed PrestaShop into a sub folder (/prestashop), then created that .htaccess file in the root folder, and changed the Base URI to "/" (instead of "/prestashop/") in the SEO preferences I only did these steps Link to comment Share on other sites More sharing options...
Julian81 Posted July 12, 2013 Share Posted July 12, 2013 I have the exact same problem. I'm trying to install a new prestashop in a root folder (/) but jquery etc is not working, When i install the same files to a subfolder eg (/prestashop/) it is working... Link to comment Share on other sites More sharing options...
vekia Posted July 12, 2013 Share Posted July 12, 2013 you have to check the base_uri field in the ps_shop table (or in backoffice > preferences > seo & urls) if you install prestashop in the root dir, the value of the base_uri must be: "/" Link to comment Share on other sites More sharing options...
mp1000751 Posted July 26, 2013 Share Posted July 26, 2013 File: classes/Media.php Methods: - getCSSPath - getJSPath If I comment these lines if (Context::getContext()->controller->controller_type == 'admin') { $js_uri = preg_replace('/^'.preg_quote(__PS_BASE_URI__, '/').'/', '/', $js_uri); $js_uri = dirname(preg_replace('/\?.+$/', '', $_SERVER['REQUEST_URI']).'a').'/..'.$js_uri; } everything is ok the question is, it's a bug or a workaround for a bad way to configure PrestaShop as root? Hi, I had the same problem. And so: how did you solve the matter? by creating that .htacces, setting / as Base URI and editing the file: classes/Media.php ? at the end: Does il works? thanks. 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