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.
Hi everyone
I have been struggling with my htaccess file for a couple of weeks. If I enable SEO I get errors from my website links. I have tried all of the different permutations in the wiki to no avail. Is there some different code for Bluehost servers?
url is http://www.french-regional-wines.co.uk
khxc is in public_html
the private directory is in the root
My .htaccess file in public_html looks like this (without SEO code)
RewriteEngine on RewriteCond %{HTTP_HOST} ^french-regional-wines.co.uk$ [OR] RewriteCond %{HTTP_HOST} ^www.french-regional-wines.co.uk$ RewriteRule ^/?$ http://www.french-regional-wines.co.uk/khxc/ [R=301,L] # Use PHP5CGI as default AddHandler fcgid-script .php FCGIWrapper /usr/local/cpanel/cgi-sys/fcgiwrapper .php
The first part of the code redirects the base url to the khxc folder - won't work without it (just shows the public_html directory in the browser).
The second part of the code was put there by Bluehost - site won't work without that either.
I am totally out of my depth here and I would e extremely grateful for any help.
thanks
John
Offline
Have you tried a file that looks like this? I removed the L from the R=301 line and added the "normal" rewrite rule for CCP.
RewriteEngine on RewriteCond %{HTTP_HOST} ^french-regional-wines.co.uk$ [OR] RewriteCond %{HTTP_HOST} ^www.french-regional-wines.co.uk$ RewriteRule ^/?$ http://www.french-regional-wines.co.uk/khxc/ [R=301] RewriteRule ^khxc/(.*)-(.*)/(.*)\.html khxc/index.php?app=$1&ns=$2&ref=$3 [L,PT] # Use PHP5CGI as default AddHandler fcgid-script .php FCGIWrapper /usr/local/cpanel/cgi-sys/fcgiwrapper .php
Offline
Hmm, I would have thought that would have helped. Hard to guess without you enabling it so we can get a better idea of what's happening.
Actually, put the ,L back on the 301 rule and leave the other line I added there. The only time that 301 should be needed and hit is if someone comes in from a different URL. Since you have the base URL configured correctly all of the URLs in the store should be coming out correctly and end up hitting the CCP rewrite rule.
RewriteEngine on RewriteCond %{HTTP_HOST} ^french-regional-wines.co.uk$ [OR] RewriteCond %{HTTP_HOST} ^www.french-regional-wines.co.uk$ RewriteRule ^/?$ http://www.french-regional-wines.co.uk/khxc/ [R=301,L] RewriteRule ^khxc/(.*)-(.*)/(.*)\.html khxc/index.php?app=$1&ns=$2&ref=$3 [L,PT] # Use PHP5CGI as default AddHandler fcgid-script .php FCGIWrapper /usr/local/cpanel/cgi-sys/fcgiwrapper .php
Offline
thanks again Dave
I have put the last code posted into my .htaccess file and have turned SEO on.
If you look at wwwfrench-regional-wines.co.uk now you can see the links in the left hand menu are wrong and result in error codes if clicked.
thanks
John
Offline
That's very odd. The only thing they're missing is the directory (khxc) but the base URL is correct and includes the /khxc so the links should be getting built correctly too. We'll have to see if someone better at rewrite rules sees this. I'm not sure what else to try I'm afraid.
Offline
The SEO style links just fine when the khxc is added so it almost has to be related to htaccess.
Offline
ok Dave sincere thanks for your time and trouble.
It has been driving me daft for weeks, I only realised that it was the .htaccess file today. I have lost count of the number of times I've reinstalled everything.
thanks
John
Offline
I've pinged another member who's better at rewrite rules than I am and asked him to take a look at this thread. Please leave SEO enabled for now if you can.
Offline
No no no, there is nothing wrong with your installation!
Offline
Dave
I had missed one vital part of the SEO process - I hadn't put the khxc directory in my root. I have now but nothing has changed - the links are still wrong.
It's getting late here and it's been a long, long day so I'm going to et some sleep soon.
Here is the current status
both the khxc and khxc_private are installed in my root directory.
SEO is enabled
My root .htaccess file is :-
RewriteEngine on
RewriteCond %{HTTP_HOST} ^french-regional-wines.co.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www.french-regional-wines.co.uk$
RewriteRule ^/?$ http://www.french-regional-wines.co.uk/khxc/ [R=301,L]
RewriteRule ^khxc/(.*)-(.*)/(.*)\.html khxc/index.php?app=$1&ns=$2&ref=$3 [L,PT]# Use PHP5CGI as default
AddHandler fcgid-script .php
FCGIWrapper /usr/local/cpanel/cgi-sys/fcgiwrapper .php
url is wwwfrench-regional-wines.co.uk
many thanks again for persevering with this
John
Last edited by frwjd (04-06-2008 17:43:56)
Offline
Hi
Just seen your reply - no I didn't, very disappointed, pretty pointless software without SEO enabled. I will try again in a couple of weeks but if it doesn't work will have to consider ditching ccp.
Offline