Jump to content

Rewrite rules for prestashop?


Recommended Posts

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

  • 2 months later...

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 folder
Another simple solucion is to create a subdomain to your prestashop folder

Link to comment
Share on other sites

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/prestashop

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
Link to comment
Share on other sites

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

×
×
  • Create New...