Page 1 of 1
SEO URLs not working properly
Posted: Fri Jun 16, 2017 1:41 pm
by glolar
Hello,
Using OpenCart 2.3.0.2.
I have Use SEO Urls set to Yes in System > Settings > Server, and I have an SEO URL set on one of my products (the setting is cobra-cp2205-2300kv-motor). Note: I have no SEO URLs on any other products until I can get this issue resolved.
1. Go to
www.skyreadyrc.com/store. Select Parts > Motors > Cobra.
2. Mouse over the first product on the left (Cobra CP-2205 2300kv Motor).
3. Notice the URL tooltip will show as "
www.skyreadyrc.com/store/cobra-cp2205-2300kv-motor", which is the correct SEO URL.
4. However, click on the product. The URL after navigation to that product page is "
www.skyreadyrc.com/store/index.php?_rou ... 00kv-motor".
I have been on Tech Support with my ISP, and they swear they have MOD_REWRITE installed correctly on the server. I have the following lines in the .htaccess file in the OpenCart install directory (/store directory) on the server (got this from an OpenCart 2.x tutorial):
# SEO URL Settings
RewriteEngine On
RewriteBase /store/
If you navigate directly to "
www.skyreadyrc.com/store/cobra-cp2205-2300kv-motor" in the browser, there are no errors.
All of the server's PHP settings can be seen here:
www.skyreadyrc.com/info.php
Does anyone know what is causing the "index.php?_route_=" to appear in the product URL? Shouldn't the URL be "
www.skyreadyrc.com/store/cobra-cp2205-2300kv-motor"?
Does anyone know the fix for this?
Thanks in advance!
Larry Sanford
Sky Ready RC
Re: SEO URLs not working properly
Posted: Fri Jun 16, 2017 2:17 pm
by imdevlper18
HI,
The major cause of this is incorrect .htaccess file.
You can try with below .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]
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]
Re: SEO URLs not working properly
Posted: Fri Jun 16, 2017 6:08 pm
by n2rtechnologies
Hi
Its look like you site is on store directory not on root.. your .htaccess file must be like
# 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 /store/
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/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]
For support please contact us
http://www.n2rtechnologies.com/
Re: SEO URLs not working properly
Posted: Fri Jun 16, 2017 10:54 pm
by glolar
n2rtechnologies, Yes, the OpenCart installation is in the /store/ directory, as I mentioned in my original post. I have the exact values in my .htaccess file that you suggest, that is why I am mystified why the URL is not showing up properly in the browser's address bar after navigating to the product page.
I think the problem lies in a server setting somewhere, but my ISP disagrees.
Any other ideas are welcomed ... I am stymied.
Thank you.
Re: SEO URLs not working properly
Posted: Sat Jun 17, 2017 4:08 am
by victorj
2 possebilities
either there are some errors in your config files https related or https setup, or youre using oc 2.2
that version has a huge problem when runing your site under ssl
Re: SEO URLs not working properly
Posted: Sat Jun 17, 2017 4:29 am
by glolar
victorj,
Using Using OpenCart 2.3.0.2, as stated in the post. Has the problem you mention been fixed in Using OpenCart 2.3.0.2?
Thank you.
Re: SEO URLs not working properly
Posted: Sat Jun 17, 2017 4:44 am
by victorj
missed version information, 2.3.x should run perfect just out off the box, unless there is a error in your config files and the way you did set it up to run ssl.
Would not mind taking a closer look to see whats going wrong.
Re: SEO URLs not working properly
Posted: Wed Jun 21, 2017 7:44 pm
by TLWebdesign
I have the exact same issue. Did you fix this problem and what fixed it for you?
Kind regards,
Tom
Re: SEO URLs not working properly
Posted: Tue Jul 04, 2017 6:16 pm
by TLWebdesign
Anyone?
Re: SEO URLs not working properly
Posted: Tue Jul 04, 2017 7:43 pm
by ADD Creative
It's probably a problem with the redirects in your htaccess. Check them against the example in a fresh install or post them here.
Re: SEO URLs not working properly
Posted: Fri Jul 07, 2017 7:08 pm
by TLWebdesign
Hi it is the standard htaccess from the upload folder. Haven't made any changes except for renaming .htaccess.txt to .htaccess
I have renamed my admin folder but that shouldn't have an affect on it.
Running DirectAdmin Apache webserver where i have the site in a subdomain wijn.domain.com the ftp file system is domain/domain.com/public_html/wijn/
I tried changing rewritebase to /wijn or /wijn/ but nothing works. no errors visible either.
htaccess file contents (important bits):
Code: Select all
Options +FollowSymlinks
# Prevent Directoy listing
Options -Indexes
# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
Require all denied
## For apache 2.2 and older, replace "Require all denied" with these two lines :
# 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=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/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]
Hope someone can help me out.
Re: SEO URLs not working properly
Posted: Fri Jul 07, 2017 8:39 pm
by ADD Creative
Looks OK. If you URLS are in the format of wijn.domain.com/prouctname then RewriteBase should just be /.
If you click on a link like wijn.domain.com/prouctname what do you get?
Do you have any redirects [R=301,L] in your htaccess?
Re: SEO URLs not working properly
Posted: Sat Jan 27, 2018 11:09 pm
by sanshay
Had the same issue before and found the problem in the settings of the seo module.
Re: SEO URLs not working properly
Posted: Tue Jun 15, 2021 2:06 pm
by karimzi_academy
rename public_html . .htaccess.txt to .htaccess or follow this step
https://karimzi.blogspot.com/2021/06/op ... rking.html