You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
We set our version 9 site live a few weeks ago and have this installed in a /K9/ subdirectory.
When we switched over to the new site we just used a very simple rewrite rule in the htaccess file :-
Options +FollowSymLinks RewriteEngine on # home page traffic is sent to /K9/index.php Rewriterule ^$ /K9/index.php
We have just been trying to get SEO friendly links switched on and have replaced our one liner with the site suggested code as follows:-
Options +FollowSymLinks RewriteEngine on # Base Software Rewrite Rules RewriteRule ^K9/index.php - [L,PT] RewriteRule ^K9$ K9/index.php?COREseourl=/ [L,PT] RewriteRule ^K9/$ K9/index.php?COREseourl=/ [L,PT] RewriteRule ^K9/sitemap\.xml K9/utilities/sitemap.xml [L,PT] RewriteCond %{REQUEST_URI} ^/K9/ RewriteCond %{REQUEST_URI} !\.(xml|css|js|gif|jpg|jpeg|png|pdf)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^K9/(.*) K9/index.php?COREseourl=/ [L,PT]
With System / Component / Settings / Search Engine Optimization Settings -> SEO Status, set to "False", everything works as normal with all url's in the ../K9/index.php?app=ecom&ns=catshow&ref=category-name format.
If we switch SEO Status to "True" all url's take the format ../K9/Category/category-name, ../K9/Item/item-name etc.
HOWEVER - doesn't matter what url is requested in this format the only page that gets displayed is the home page.
requesting a page in the .../index.php?app=... format displays the correct page.
ErrorDocument 404 /K9/index.php was commented out during the test as were other 301 redirects.
Looks like we must have something wrong in the htaccess rules but as far as I can tell these are the correct rules as generated by the site and checked against the documentation. Other posts seem to indicate that these are the rule so not sure where to look at what is causing the SEO friendly url's not to display.
Any suggestions much appreciated.
Thanks
Offline
Thanks Nick.
However, this has not solved the problem.
A bit of further testing has revealed that the htaccess file as is does not actually send requests to the K9 directory.
That is with the the htaccess file exactly as generated by the site requests to http://domain.co.uk go to the index file in the root directory and do not get rewriten to ./K9/index.php
Did not initially notice this since all the urls I was testing previously have the /K9/ directory included.
Rewriterule ^$ /K9/
Does take everything to the /K9 directory - but not sure what that does to the other rules.
Testing gave very similar results with everything working with SEO Status set to False but only the home page displaying when set to True.
Maybe I need, "The Definitive Guide to Apache Mod_rewrite" on my wish list.
Offline
It is improper to go live and redirect all / traffic to /K9. SEO issues will occur. Are you going live, or just testing? If you're just testing, get rid of that redirect rule at the top:
Rewriterule ^$ /K9/
If you're actually going live, you should be moving everything in /K9 to the root and doing proper root rewrites.
Offline
OK so unlike our old V6 site you can't run a live site from a subdirectory. Missed that bit.
Will move into the root folder and re-run the installer then try the htaccess rules for the root directory.
Offline
No, you can do it. It's just advised not to. If you want to do that, remove that first rule and do it. It is very bad SEO practice to take every request pointed to your homepage and rewrite it to a subdirectory - you will lose juice and rank. You might as well have whatever is in that subdirectory in the root.
Offline
OK have moved everything from K9 to root and all is working fine and I have the htaccess rules working now.
Have also discovered differences in the suggested rules.
/ System / Helpers / SEO Htaccess Builder gives the following code:-
RewriteRule ^index.php - [L,PT] RewriteRule ^$ index.php?COREseourl=/ [L,PT] RewriteRule ^/$ index.php?COREseourl=/ [L,PT] RewriteRule ^sitemap\.xml utilities/sitemap.xml [L,PT] RewriteCond %{REQUEST_URI} ^/ RewriteCond %{REQUEST_URI} !\.(xml|css|js|gif|jpg|jpeg|png|pdf)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) index.php?COREseourl=/ [L,PT]
The documentation shows the following code:-
RewriteRule ^index.php - [L,PT] RewriteRule ^/$ index.php?COREseourl=/ [L,PT] RewriteRule ^sitemap\.xml utilities/sitemap.xml [L,PT] RewriteRule ^rss\.xml utilities/rss.xml [L,PT] RewriteCond %{REQUEST_URI} ^/ RewriteCond %{REQUEST_URI} !\.(xml|css|js|gif|jpg|jpeg|png|pdf)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) index.php?COREseourl=/$1 [L,PT]
There is the inclusion of the extra 2nd line in the "helper" code:-
RewriteRule ^$ index.php?COREseourl=/ [L,PT]
Have no idea if this makes any difference just thought I would point it out.
The rules the seem to be working fine for us are the set from the documentation.
Offline
The helper code is correct, although an update is pending for K9 in which I think there was a change. Where did you see that .htaccess code you referenced from 'documentation'. If it's in the K9 beta manual, I need to change it. Thanks.
Offline
Hi Nick,
Thanks will drop the extra line into my .htaccess.
The code I found in the documentation is here:-
https://kryptronic.com/DEVMANUAL/SEO-an … -Setup.php
Don't know if that is the home of the manual I am supposed to be referring to - it was on a link in an email when K9 got set up and I have been using it ever since.
Offline
Yes this version really helpful to get switched SEO friendly link.
Offline
Bumping an old thread here because I've tried activating SEO friendly URLs in my v9 install, but when I use the code from post #7 above https://forum.kryptronic.com/viewtopic. … 26#p159426 I get a 500 error.
Is there a more up to date version of this?
Offline
I've found this in the Dashboard / System / Component / Settings / Helpers but although the splash page is ok, any time I try to select any other page, eg category, product, account overview etc I get the 500 error.
I'm using cPanel rather than Apache, but I was told by my hosts that it would still work the same.
# Gzip Compression for Speed AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript # Caching for Speed <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/gif "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType text/css "access plus 1 month" ExpiresByType image/x-icon "access plus 1 month" ExpiresDefault "access plus 1 month" </IfModule> # Disable Default Character Set AddDefaultCharset Off # Activate Rewite Engine Options FollowSymLinks RewriteEngine On # Custom Rewrite Rules - Add Any Custom Rules Below # Base Software Rewrite Rules RewriteRule ^index.php - [L,PT] RewriteRule ^$ index.php?COREseourl=/ [L,PT] RewriteRule ^/$ index.php?COREseourl=/ [L,PT] RewriteRule ^sitemap\.xml utilities/sitemap.xml [L,PT] RewriteCond %{REQUEST_URI} ^/ RewriteCond %{REQUEST_URI} !\.(xml|css|js|gif|jpg|jpeg|png|pdf)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) index.php?COREseourl=/$1 [L,PT]
Offline
I've found that cPanel servers are very touchy when it comes to editing .htaccess files. Try using the .htaccess you posted above, but use the WHM file manager to edit and save the file. cPanel does something to the file encoding that you can't replicate with a change via FTP.
Offline
Thanks for information !
Offline
The problem seems to be with the very last line
RewriteRule ^(.*) index.php?COREseourl=/$1 [L,PT]
If I take that out, there's no 500 error (only a 404)
BTW it seems to be trying to rewrite to https://affordableleather.co.uk/Categor … fs-mittens
Is it possible to change "Category" to "category" with a lower case c to keep things consistent?
Offline
Your last line looks correct. I'm not sure what's going on there. Try putting a break at the end of the line so it's not the last one in the file. End the file with a blank line and see if that helps.
Concerning changing the SEOURL base, you can use System / Database / Raw DB Admin to browse the core_namespaces table. Locate the id 'ecom.catshow' and change it's seourl parameter from 'Category' to 'category'.
Offline
I added an extra line, but that didn't help
# Gzip Compression for Speed AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript # Caching for Speed <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/gif "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType text/css "access plus 1 month" ExpiresByType image/x-icon "access plus 1 month" ExpiresDefault "access plus 1 month" </IfModule> # Disable Default Character Set AddDefaultCharset Off # Activate Rewite Engine Options FollowSymLinks RewriteEngine On # Custom Rewrite Rules - Add Any Custom Rules Below # Base Software Rewrite Rules RewriteRule ^index.php - [L,PT] RewriteRule ^$ index.php?COREseourl=/ [L,PT] RewriteRule ^/$ index.php?COREseourl=/ [L,PT] RewriteRule ^sitemap\.xml utilities/sitemap.xml [L,PT] RewriteCond %{REQUEST_URI} ^/ RewriteCond %{REQUEST_URI} !\.(xml|css|js|gif|jpg|jpeg|png|pdf)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) index.php?COREseourl=/$1 [L,PT] # Extra line to try to fix 500 error
This is the exact error message I'm getting:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@affordableleather.co.uk to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Offline