Editing .htaccess file? - Configuring and using PrestaShop - PrestaShop

Jump to content


Editing .htaccess file?


Posted 17 September 2010 - 10:57 AM


    PrestaShop Newbie

  • Members
  • Pip
  • 21 Active Posts
Hello there,
I am hosting my site with hostmonster.Previously my site had a problem of displaying my main homepage on http://www.electroni...com/prestashop. As for the main page http://www.electronicsforeal.com would be displaying the test prestashop page with dummy characters.I contacted hostmonster and they helped me solve this by editing public_html/.htaccess file so as to redirect the contents of http://www.electroni....com/prestashop to http://www.electronicsforeal.com so that both of the urls are pointing to the same main page.

the code i used was
# Use PHP5 Single php.ini as defaultAddHandler application/x-httpd-php5s .php# Hostmonster.com# .htaccess main domain to subdirectory redirect# 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# Change electronicsforeal.com to be your main domain.RewriteCond %{HTTP_HOST} ^(www.)?electronicsforeal.com$# Change 'prestashop' to be the directory you will use for your main domain.RewriteCond %{REQUEST_URI} !^/prestashop/# Don't change this line.RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-d# Change 'prestashop' to be the directory you will use for your main domain.RewriteRule ^(.*)$ /prestashop/$1# Change electronicsforeal.com to be your main domain again.# Change 'prestashop' to be the directory 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.)?electronicsforeal.com$RewriteRule ^(/)?$ prestashop/index.php [L]

and redirection was successful.
Now the problem arose again after i enabled friendly url and generated .htaccess file by creating /prestashop/.htaccess

the old .htaccess file above had been replaced by this here

# URL rewriting module activationRewriteEngine on# URL rewriting rulesRewriteRule ^([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]+)(\-[_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]

And the previous problem of two different pages for http://www.electroni....com/prestashop and http://www.electronicsforeal.com is here again.

Could somebody help me how i can manipulate the new .htaccess code to get http://www.electroni....com/prestashop point to my domain name http://www.electronicsforeal.com?

I have tried to add the old .htaccess code to the new one generated after generating .htaccess but didn’t work.

Thanks and very sorry for the long explanation and code

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cookies help us deliver our services. By using our services, you agree to use our cookies.     Learn more