haagendazs Posted September 3, 2008 Share Posted September 3, 2008 hi!right now i have prestashop installed in a subdirectory of the root, so it looks like root.com/prestashop/, and that would give you the index of my shop. however, i want it to get rid of the /prestashop/ part in the URL, so product pages would say something like root.com/product.php?product_id=etcetc... instead of root.com/prestashop/product.php... I know that installation tells you to install prestashop in the root, but i want to put it in a subdirectory to keep it clean and so it wont conflict with other installations of other stuff.my question is, does anyone know how to use mod_rewrite and RewriteRules to get rid of the /prestashop/ in the URL without physically moving the entire installation to the root?thanks a lot!ps. if you're not sure what i mean and you're familiar with Wordpress, Wordpress has the exact same feature in its General Settings called "Blog Address" and "Wordpress Address". the "Blog Address" is what you want visitors to go to to see your site (usually domain.com) and "Wordpress Address" is where your Wordpress install is physically located in your server (usually domain.com/blog) Link to comment Share on other sites More sharing options...
Jo! Posted November 30, 2008 Share Posted November 30, 2008 I have the same question... Link to comment Share on other sites More sharing options...
hieloiceberg Posted November 30, 2008 Share Posted November 30, 2008 In order to do that you will need to have a .htaccess that has this on it. Just change the “your_domain.com” for yours and the “prestashop” for the folder name you are using RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?your_domain.com$ RewriteCond %{REQUEST_URI} !^/prestashop/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /prestashop/$1 RewriteCond %{HTTP_HOST} ^(www.)?your_domain.com$ RewriteRule ^(/)?$ prestashop/index.php [L] you have to add the .htaccess to your root folderAnother simple solucion is to create a subdomain to your prestashop folder Link to comment Share on other sites More sharing options...
Odjavel Posted November 30, 2008 Share Posted November 30, 2008 Isn't it enough to put a simple "/" in the "PS Directory" field ?I didn't try.. Link to comment Share on other sites More sharing options...
hieloiceberg Posted December 1, 2008 Share Posted December 1, 2008 Isn't it enough to put a simple "/" in the "PS Directory" field ?I didn't try.. Well Odjavel they already have it that way at list haagendazs does www.domain.com/prestashopBut he wants the domain to go directly to the prestashop folder without the /prestashop_folder showing at address bar.Mmm I think that’s what he wants lol Link to comment Share on other sites More sharing options...
Jo! Posted December 1, 2008 Share Posted December 1, 2008 But he wants the domain to go directly to the prestashop folder without the /prestashop_folder showing at address bar.Mmm I think that’s what he wants lol Yeeesss.. Exactly. And let's see what we'll get. I'll post here, if everything's OK.Thx anyway! Link to comment Share on other sites More sharing options...
hieloiceberg Posted December 1, 2008 Share Posted December 1, 2008 Okis Jo! I hope it helps Link to comment Share on other sites More sharing options...
Jo! Posted December 5, 2008 Share Posted December 5, 2008 Hehehe!IT WORKS!!! TNX to hieloiceberg:-D(although it makes some lags @ server... but it depends on server power - probably regular expressions need to be optimized???) Link to comment Share on other sites More sharing options...
Recommended Posts