Page 3 of 3

Re: Friendly URLs .htaccess help

Posted: Wed Dec 26, 2012 6:00 pm
by bibubaba
this is not really a complete list but you can see what is all about.. errors are only shown when site is opening for too long.. and of course then I get 500 internal error.. i contacted godaddy hosting they said they are still working on smth (but really don't know what).. if you have any solutions I would really appreciate it. Ande yes, after enabling SEO, my site is working, but when you click on any other item it will only show the same item.. i can give you ftp account or opencart login if you can help me out.. this is really frustrating for me. and I am working with this for a couple of months now.

Re: Friendly URLs .htaccess help

Posted: Tue Jan 01, 2013 6:59 am
by tdaubs
I struggled a great deal with Godaddy for many years. I worked for a company that chose GD as their host of choice. After quite the struggle with GD support (or lack thereof) and many emphatic discussions with my boss, we finally moved off of GD for good. I can't emphasize how much I dislike GD but I can tell you their hosting is abysmal and their support is lacking.

I recommend building your business on a professional hosting company... and GD is not that.

Re: Friendly URLs .htaccess help

Posted: Mon Jan 07, 2013 10:25 am
by altxpress
thank you for this post it helped me out

Re: Friendly URLs .htaccess help

Posted: Mon Feb 25, 2013 11:22 pm
by davski13
Luckily I have very little hair to pull-out but I am having issues with this.

I have given each product and each category a unique seo name, I have switched to 'use SEO URLs', I have added a .htaccess into the root folder (same as config.php etc):

Code: Select all

# 1.To use URL Alias you need to be running apache with mod_rewrite enabled. 
 
# 2. In your opencart directory rename htaccess.txt to .htaccess.
 
# For any support issues please visit: http://www.opencart.com
 
Options +FollowSymlinks
 
# Prevent Directoy listing
Options -Indexes
 
# Prevent Direct Access to files
 
 Order deny,allow
 Deny from all
 
# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/ 
 
RewriteBase /
RewriteRule sitemap.xml /index.php?route=feed/google_sitemap
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
 
### Additional Settings that may need to be enabled for some servers
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.
 
# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off
 
# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off
 
# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M
 
# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M
 
# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200
 
# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200
I keep getting 'Forbidden You don't have permission to access...' and my hosting company state "You can use mod_rewrite code in htaccess file it is available on all servers." I'm using Opencart 5.1.4. Everyone seems to be suggesting (especially SEO 'experts' that this is easy to to but from my experience, and judging by the many queries in forums such as these, I fail to see how it can be!

Cheers

Re: Friendly URLs .htaccess help

Posted: Tue Feb 26, 2013 12:39 pm
by cwswebdesign
I had a strange case the other day and I had to blockout the RewriteBase / line by putting a # before it. Try this and see if your issue is fixed or not.

DL

Re: Friendly URLs .htaccess help

Posted: Tue Feb 26, 2013 4:09 pm
by davski13
My server administrator suggested removing the 'Deny from all' line in the .htaccess file which has solved the problem. (Sorry, tried to post this yesterday but the over-cautious spam catcher prevented me from doing so!).

Re: Friendly URLs .htaccess help

Posted: Fri Nov 01, 2013 5:24 am
by Karkaen
I had problem with featured section at homepage. When i click on manufacturer it would lead me to localhost. This is how I solwed it.

1. Rename ".htacces.tnx" to .htacces. You can find it in root,under the admin,catalog etc. folders.
2.This is what .htacces should contain

Code: Select all

# 1.To use URL Alias you need to be running apache with mod_rewrite enabled. 

# 2. In your opencart directory rename htaccess.txt to .htaccess.

# For any support issues please visit: http://www.opencart.com

Options +FollowSymlinks

# Prevent Directoy listing 
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
 Order deny,allow
 Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/ 

RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

### Additional Settings that may need to be enabled for some servers 
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.

# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
 php_flag register_globals off

# 2. If your cart has magic quotes enabled, This may work to disable it:
 php_flag magic_quotes_gpc Off

# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
 php_value upload_max_filesize 999M

# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
 php_value post_max_size 999M

# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
 php_value max_execution_time 200

# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
 php_value max_input_time 200

# 7. disable open_basedir limitations
 php_admin_value open_basedir none
3. In setings turn SEO URL to "No" (sounds strange but it working for me).
4.Make sure your URLs at banner window are formed like this (example) : "index.php?route=product/manufacturer/product&manufacturer_id=13" (make sure id number at the end is correct).

I hope it helped,good luck.

Re: Friendly URLs .htaccess help

Posted: Sat Jan 18, 2014 11:17 am
by Jhewell0508
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteRule ^index\.php$ https://www.example.com? [R=301,L]



www.example.com needs to be your site

Re: Friendly URLs .htaccess help

Posted: Tue Apr 08, 2014 2:35 pm
by UnifiedAmit
Here is the solution of this problem.


First go to .htacess file and the put these two lines :
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]


It will automatic redirect to http to https

Here is the code of my htacess file:

RewriteBase /
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

RewriteRule sitemap.xml /index.php?route=feed/google_sitemap
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

Re: Friendly URLs .htaccess help

Posted: Thu Apr 10, 2014 7:14 pm
by inveostore.com
For redirects to HTTP always use:

Code: Select all

RewriteCond %{HTTPS} !^on$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]

Re: Friendly URLs .htaccess help

Posted: Fri Feb 13, 2015 11:41 pm
by smudge
I had an issue in my html (apache) config file with a default setting which was preventing the .htaccess file from being read

As mentioned earlier if you populate a .htaccess file with " aloud of crap" this should cause a 500 error in apache as long as it saved in the the correct directory of your open cart shop.

If you don't see this check you apache http.conf file ( or similar in your apache version)

In my case we use a subdirectory under the root /var/www/html filer called shop

so in /etc/httpd/confhttpd.conf file I should have had

<VirtualHost *:80>
ServerAdmin emailme@mydomain.com
DocumentRoot /var/www/html/eshop
<Directory /var/www/html/eshop>
Options Indexes
# AllowOverride none
AllowOverride All
DirectoryIndex index.php
Order allow,deny
allow from all
</Directory>
</VirtualHost>

But instead AllowOverride none was set and any changed I made to .htaccess made no differnce

Obvious when you know why !

thought i'd share this incase anyone else is scratching their head why their SEO isn't working on open cart
:crazy:

Re: Friendly URLs .htaccess help

Posted: Thu Feb 25, 2016 7:03 pm
by Ben23
nashant wrote:If you haven't got it installed to root then make sure you change the rewritebase to /opencart_directory/
Why is that RewriteBase even there? It's completely unnecessary and prevents SEO URLs from working out of the box when OC is not installed at root. I would recommend simply removing that line. You don't need it except in very unusual circumstances.

Re: Friendly URLs .htaccess help

Posted: Tue Mar 22, 2016 5:25 am
by Gbt
Hello to All,

Could help please with clearing of urls.
1. I switched - using SEO url -> to On
2. I renamed the .htaccess file
3. I copied a different code that I had found some of the forum topic, I put that code in the htaccess file. Nothing...

It's intersting, but before everything was okay.

here is the annoying "index.php?_route_="
1.The category is: All-photography/
2./Winter-Road-Snow-Blue-Sky-Picture-Travel-Season-Roman is a picture tag.

https://mysite.com/index.php?_route_=Al ... on-Romance

Here is the .htaccess code

Code: Select all

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/ 

RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteRule ^index\.php$ http://www.mywebsite.com? [R=301,L]
I tried with: http://mywebsite.com? [R=301,L] - no difference

Re: Friendly URLs .htaccess help

Posted: Fri Apr 01, 2016 4:58 am
by Gbt
Still not resolved the problem.

Re: Friendly URLs .htaccess help

Posted: Sat Jul 30, 2016 12:58 pm
by kiendongpro
Thank so much.

Re: Friendly URLs .htaccess help

Posted: Sun Jul 31, 2016 2:53 am
by straightlight
This topic may help you to resolve this issue: http://forum.opencart.com/viewtopic.php?f=191&t=165616

Re: Friendly URLs .htaccess help

Posted: Wed Aug 24, 2016 1:51 pm
by John1988
hi i deleted the file thaccess.txt by accident. so created a new file in coda2 text editor program. i named it thaccess.txt and paste some code that i found in this forum., never thought this was gonna happened now my site does not open anymore after i uploaded to root folder i renamed as .thaccess the file despaired and the site shows this error

Forbidden

You don't have permission to access / on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
somebody please help me out fix my site.

this is the code i copied and then pasted in the file thaccess.txt

# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.

# 2. In your opencart directory rename htaccess.txt to .htaccess.

# For any support issues please visit: http://www.opencart.com

Options +FollowSymlinks

# Prevent Directoy listing
Options -Indexes

# Prevent Direct Access to files

Order deny,allow
Deny from all

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/

RewriteBase /
RewriteRule sitemap.xml /index.php?route=feed/google_sitemap
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

### Additional Settings that may need to be enabled for some servers
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.

# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off

# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off

# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M

# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M

# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200

# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200