Jump to content

Installing Friendly URLs


Recommended Posts

My site files are all located in /httpdocs. Not in a sub folder. When I generate .htaccess file the front page goes completely blank. I have tried /httpdocs/ in preferences but no joy. Any idea what is going wrong? This is the ps generated file:

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

# URL rewriting module activation
RewriteEngine on

# URL rewriting rules
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /prestashop/img/p/$1-$2$3.jpg [L,E]
RewriteRule ^([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /prestashop/img/p/$1-$2.jpg [L,E]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /prestashop/img/c/$1$2.jpg [L,E]
RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop/product.php?id_product=$3&isolang;=$1$5 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop/product.php?id_product=$2&isolang;=$1$4 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /prestashop/category.php?id_category=$2&isolang;=$1 [QSA,L,E]
RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop/product.php?id_product=$2$4 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /prestashop/product.php?id_product=$1$3 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /prestashop/category.php?id_category=$1 [QSA,L,E]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /prestashop/cms.php?id_cms=$1 [QSA,L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /prestashop/supplier.php?id_supplier=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /prestashop/manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/(.*)$ /prestashop/$2?isolang=$1 [QSA,L,E]

# Catch 404 errors
ErrorDocument 404 /prestashop/404.php

Link to comment
Share on other sites

If I just remove " /prestashop" from each statement in the .htaccess file, would that sort the problem? I'll give it a try. Site is currently down due my trying change my preference location from / to something else.

Dusty

Link to comment
Share on other sites

If your PrestaShop files are in the /httpdocs/ directory, change your "PS directory" on the Preferences tab from /prestashop/ to / or if you can't access your Back Office, edit config/settings.inc.php and change the __PS_BASE_URI__.

Link to comment
Share on other sites

Hi Rocky.
"PS Directory" is set to "/" already. Data base shows PS_BASE_URI / . Have just finally managed to get site back up and running. It was a bit of a nightmare. Will have a go at removing “ /prestashop” and see what happens.
regards,
Dusty

Link to comment
Share on other sites

Went through the whole process again. This is the new file:

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

# URL rewriting module activation
RewriteEngine on

# URL rewriting rules
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2$3.jpg [L,E]
RewriteRule ^([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2.jpg [L,E]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg [L,E]
RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$3&isolang;=$1$5 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang;=$1$4 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang;=$1 [QSA,L,E]
RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$1 [QSA,L,E]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms=$1 [QSA,L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/(.*)$ /$2?isolang=$1 [QSA,L,E]

# Catch 404 errors
ErrorDocument 404 /404.php



All I get when I load F/O is a blank page. B/O works ok.

Any suggestions?

I tried adding some code from my old .htaccess file:

RemoveHandler .php
AddType application/php5-fcgi php
Action application/php5-fcgi /cgi-bin/php5fcgi.fcgi



Web pages are available again but urls are a bit strange ie:

http://www.landnsea.co.uk/clothing/14-http-wwwlandnseacouk-productphpidproduct14.html

Link to comment
Share on other sites

Went back to presta generated .htaccess file (without the extra code) turned off friendly urls but now when I try to checkout I get the following:

https://www.landnsea.co.uk/order.php?step=1

Not Found

The requested URL /order.php was not found on this server.

I don't have ssl and I am using httpdocs not httpsdocs

Any Ideas what could possibly have happened?

Link to comment
Share on other sites

  • 5 weeks later...

To me it seems to have the same prob./
Only that I cannot access the BO.
My subfolder is onedollarshop and my subdomain too.
ie. http://onedollarshop.freemoneyhome.com like that.

I installed the .htaccess in the subfolder called onedollarshop. Everything is working fine including the friendly urls but I cannot access the BO.

Do you want me to try changing the PS_BASE_URI / to PS_BASE_URI /onedollarshop.

Initially I tried that, but then my url was searching for the file called like this.
http://onedollarshop.freemoneyhome.com/onedollarshop which doesnot exist.

Please help. What should I do now?

Link to comment
Share on other sites

  • 4 weeks later...
To me it seems to have the same prob./
Only that I cannot access the BO.
My subfolder is onedollarshop and my subdomain too.
ie. http://onedollarshop.freemoneyhome.com like that.

I installed the .htaccess in the subfolder called onedollarshop. Everything is working fine including the friendly urls but I cannot access the BO.

Do you want me to try changing the PS_BASE_URI / to PS_BASE_URI /onedollarshop.

Initially I tried that, but then my url was searching for the file called like this.
http://onedollarshop.freemoneyhome.com/onedollarshop which doesnot exist.

Please help. What should I do now?


Hi,

Did anyone answered your query?
Did you resolve the problem?
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...