Jump to content

Friendly URL/url rewrite not working on Godaddy


Recommended Posts

I've just installed Prestashop 1.4.6.2 on a Godaddy shared deluxe linux hosting account. I've searched the forums and found similar requests but no resolution.

 

I have done this:

  1. Preferences -> SEO & URL -> Enabled "Friendly URL" checkbox.
  2. Tools-> Generators -> Generate htaccess.

But now when I click any of the links on the home page the home page just reloads.

 

 

As part of my testing I've currently got chmod 777 on all files & folders. But that isn't making a difference.

 

If I turn off "Friendly URL" then the site works correctly, however with non-SEO friendly URLs.

 

I have attached my php5.ini file and my .htaccess file (renamed prior to zipping so I can easily work with the file on my Windows workstation) for review.

 

Any help that you can offer is appreciated; please let me know if I can provide any further information to assist in finding a resolution.

 

Thanks in advance,

Alan

php5.zip

htaccess.zip

Link to comment
Share on other sites

  • 4 weeks later...

I had the same issue, and was able to solve with using this as my httaccess:

 

# Do not remove this line, otherwise mod_rewrite rules will stop working

#RewriteBase /

# URL rewriting module activation

RewriteEngine on

RewriteCond %{REQUEST_METHOD} !^(TRACE|TRACK|GET|POST|HEAD)$

RewriteRule .* - [F]

RewriteBase /

Options +FollowSymLinks

# 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

Options -MultiViews

Link to comment
Share on other sites

  • 1 month later...

I am having exactly same problem without any solution yet I tried code you posted heshkak , it didn't work I'll include my php5.ini and .htaccess files.

 

In my case main diffirence is I am getting "We're sorry, but the Web address you entered is no longer available" page-not-found error.

 

IF possible let me know what is wrong. I am on new G4 GoDaddy Hosting plan. Only one thing has been edited by me is ini file. I deleted php.ini thatwas on server by default and created php5.ini with exactly same content as in original php.ini but one line insteads of allow_url_fopen = off I edited to allow_url_fopen = On.

 

Please help.

php5.zip

.htaccess.zip

Link to comment
Share on other sites

Make your ".HTACCESS" look exactly like this:

 

# URL rewriting module activation

RewriteEngine on

RewriteCond %{REQUEST_METHOD} !^(TRACE|TRACK|GET|POST|HEAD)$

RewriteRule .* - [F]

RewriteBase /

Options +FollowSymLinks

 

# URL rewriting rules

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]

 

# Catch 404 errors

ErrorDocument 404 /404.php

Make sure you clear your browser's cookies if you dont notice any change. Also go to the sitemap module and update it just to be safe.

Link to comment
Share on other sites

I have a problem on my website with 404 too.

 

I have a few CMS on my website: About us, Contact, Delivery etc... Normally when I click on these it will show the content of the page, however quite often it shows 404-Page not found and if I try to re-click again for a few more times the CMS pages works again and shows the correct content!

 

Any suggestion so that I can get rid of the problem?

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 months later...
  • 2 months later...

I was looking for the answer to this issue for quite some time Caprice. The answer can be found here:

 

http://forge.prestashop.com/browse/PSCFI-2597

 

 

In short, you need to add to your htaccess file the following line:

Options -Multiviews

 

Just go into tools/generators then under specific configuration copy/paste that line and generate a new htaccess file. I kept looking at this thread a few months ago trying every option above to fix it, but this is the fix that finally fixed those issues for me.

 

Hope this helps!

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Thanks shiggidydog! That worked! However, I am still having problems with some pages loading. I believe this is because there are more than 1 htaccess files in my prestashop folder and I haven't added the multiviews code to all of them. I am struggling to find where the others are. This wasn't previously a problem since you generated the htaccess file in the back office though with the new version (1.5), I don't believe you can edit the htaccess file in the back office?

 

If not please let me know where all the htaccess files are located.

 

Also, I noticed the comment 'Thank you.

A new option will appears in the next version of Prestashop, to automaticaly add this line.'

 

Please be aware, this line has not been automatically added to new versions since I had this problem with 1.5.2

Link to comment
Share on other sites

This is very strange, I have played around changing the options for 'route to category' .etc and by simply removing the "-" between the brackets }-{ I made my category links work.

 

I still, however, can't get specific links to work suc as 'my account' or 'our stores'

 

There must be some kind of solution that solves all links (not just specific ones)? Any help is appreciated.

post-389218-0-63413400-1351076482_thumb.png

Link to comment
Share on other sites

  • 2 months later...

I have Prestashop 1.5.3.1 with no customizations / shared Linux hosting with Godaddy.

 

My Friendly URL doesn't work. Many links go invalid "404 Page Not Available". Example: all tags, Login, Cart, Search - all don't work.

If I disable Friendly URL then all the links mentioned start working.

 

I see that the .htaccess generated in 1.5 looks a bit different than what you guys posted previously here for 1.4. I have tried a few things on the .htaccess file reading on other forums to no avail.

 

Any help would be appreciated.

Edited by dformica (see edit history)
Link to comment
Share on other sites

Thank you shiggidydog,

 

We appreciate the time you took to clarify what solution worked for you. This will better enable us to support our merchants who have had similar problems with GoDaddy. Thanks for choosing PrestaShop!

 

Benjamin

 

Benjamin, I'm running out of time to go live and I can't resolve this problem (please see my post #13).

Thanks in advance for any advice.

Link to comment
Share on other sites

I have Prestashop 1.5.3.1 with no customizations / shared Linux hosting with Godaddy.

 

My Friendly URL doesn't work. Many links go invalid "404 Page Not Available". Example: all tags, Login, Cart, Search - all don't work.

If I disable Friendly URL then all the links mentioned start working.

 

I see that the .htaccess generated in 1.5 looks a bit different than what you guys posted previously here for 1.4. I have tried a few things on the .htaccess file reading on other forums to no avail.

 

Any help would be appreciated.

 

I have to add the fact that I called GoDaddy and they confirmed that mod_rewrite is active.

I also ran a test by just putting the below code in my .htaccess file. Then hit my website http://www.mydomain.com/testpage.html and it does take me to google.com. So rewrite is working properly.

 

TEST CODE FOR .HTACCESS FILE:

RewriteEngine on
RewriteRule testpage\.html http://www.google.com [R]

 

So please anyone any advice? tips? whatever to help me get the Friendly URLs working?

Edited by dformica (see edit history)
Link to comment
Share on other sites

I have to add the fact that I called GoDaddy and they confirmed that mod_rewrite is active.

I also ran a test by just putting the below code in my .htaccess file. Then hit my website http://www.mydomain.com/testpage.html and it does take me to google.com. So rewrite is working properly.

 

TEST CODE FOR .HTACCESS FILE:

RewriteEngine on
RewriteRule testpage\.html http://www.google.com [R]

 

So please anyone any advice? tips? whatever to help me get the Friendly URLs working?

 

I want to give my most sincere THANKS to alanmp for his post #40.

Even though his post was for 1.5.2 it worked for my 1.5.3.1. Thanks!

 

I just added to my .htaccess file on line 1 and 2 the below:

#Fix Rewrite

Options -Multiviews

Edited by dformica (see edit history)
Link to comment
Share on other sites

I'm glad this works for you!

 

That said, if you don't put it above where PS writes it will be overwritten very soon and you will need to add it again.

 

It should be placed above these lines.

 

 

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution

# http://www.prestashop.com - http://www.prestashop.com/forums

 

So it will look like this,

 

#Fix Rewrite

Options -Multiviews

 

 

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution

# http://www.prestashop.com - http://www.prestashop.com/forums

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...

Hi guys! I have the same problem with prestashop 1.5.6.0 version. I saw the post of shiggidydog, but Im dont know if it would works for me, because I have other version. Please help.  My friendly only works on my products but not on my account, checkout and other important sections. My clients can't pay because 404 page appears. Im using godaddy linux hosting.

Link to comment
Share on other sites

  • 1 year later...

I am also using prestashop 1.5.6 english for my site http://www.slmobileprice.com

 

I am also facing same issue friendly url is not working getting error URL rewriting (mod_rewrite) is not active on your server, or it is not possible to check your server configuration. If you want to use Friendly URLs, you must activate this mod.

 

Using godaddy windows plesk. 

 

Can any one please help me to solve the issue.

 

Thanks,

Somit

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...