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.
Pages: 1 2
I'm trying to get .htaccess to redirect a request for http://affordable-leather.co.uk to http://www.affordable-leather.co.uk but using the code below both still come back as 200 rather than the non-www version coming back as 301
I can't simply check for not having a www because when you go to the shopping cart etc it looks for the address https://secure4.site-login.net/affordab … o.uk/ccp8/
I've tried using RewriteCond %{HTTP_HOST} !^secure and RewriteCond %{HTTP_HOST} !^https://secure4.site-login.net/affordable-leather.co.uk/ccp8/ but that hasn't helped.
NB the software is in the folder /ccp8 so I also redirect all requests to http://www.affordable/leather.co.uk/ccp8/(whatever) but if I change the [L] to [R=301,l} then both www and non-www versions return a 301
Can someone please show me where I'm going wrong.
# Turn Rewite Engine On Options +FollowSymLinks RewriteEngine On # Redirect non-www to www address RewriteCond %{HTTP_HOST} ^http://affordable-leather\.co\.uk RewriteRule (.*) http://www.affordable-leather.co.uk/$1 [R=301,L] # Redirect base url to go straight to ccp8 splash page: Moved from above Redirect non-www RewriteRule ^$ /ccp8/ [L] # Redirect /shop to /ccp8 RewriteRule ^shop/(.*) http://www.affordable-leather.co.uk/ccp8/$1 [L,R=301] # Fix broken link for HAR 32 RewriteRule ^item--(.*) http://www.affordable-leather.co.uk/ccp8/item--$1 [R=301,L] # Fix broken links to xmod reviews RewriteRule ^ccp8/ecom-xmodreviewsf/(.*)\.html$ http://www.affordable-leather.co.uk/ccp8/Item/$1 [R=301,L] # Fix broken links to ecom-prodshow RewriteRule ^ccp8/ecom-prodshow/(.*)\.html$ http://www.affordable-leather.co.uk/ccp8/Item/$1 [R=301,L] # Fix broken links to email friend RewriteRule ^ccp8/ecom-emailfriend/(.*)\.html$ http://www.affordable-leather.co.uk/ccp8/Item/$1 [R=301,L] # ATS SEO RewriteRule ^([^/].+)/([^--].+)--(.+)\.html$ ccp8/index.php?app=ecom&ns=prodshow&ref=$3 [L,PT] RewriteRule ^([^--].+)--(.+)\.htm$ ccp8/index.php?app=cms&ns=display&ref=$2 [L,PT] RewriteRule ^([^--].+)--(.+)\.html$ ccp8/index.php?app=ecom&ns=catshow&ref=$2 [L,PT] RewriteRule ^(.*)-(.*)/(.*)\.html ccp8/index.php?app=$1&ns=$2&ref=$3 [L,PT] # Old SEO Rule Rewrites RewriteRule ^ccp8/cat--(.*)--(.*)\.html ccp8/index.php?app=ecom&ns=catshow&ref=$2 [L,PT] RewriteRule ^ccp8/item--(.*)--(.*)\.html ccp8/index.php?app=ecom&ns=prodshow&ref=$2 [L,PT] RewriteRule ^ccp8/page--(.*)--(.*)\.html ccp8/index.php?app=cms&ns=display&ref=$2 [L,PT] RewriteRule ^ccp8/store ccp8/index.php?app=ecom&ns=splash [L,PT] RewriteRule ^ccp8/splash ccp8/index.php?app=cms&ns=display&ref=splash [L,PT] # Version 8 Rewrite Rules RewriteRule ^ccp8/index.php - [L,PT] RewriteRule ^ccp8$ index.php?COREseourl=/ [L,PT] RewriteRule ^ccp8/$ ccp8/index.php?COREseourl=/ [L,PT] RewriteRule ^ccp8/sitemap\.xml ccp8/utilities/sitemap.xml [L,PT] RewriteRule ^ccp8/rss\.xml ccp8/utilities/rss.xml [L,PT] RewriteCond %{REQUEST_URI} ^/ccp8/ RewriteCond %{REQUEST_URI} !\.(xml|css|js|gif|jpg|jpeg|png|pdf)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ccp8/(.*) ccp8/index.php?COREseourl=/$1 [L,PT]
Offline
RewriteCond %{HTTP_HOST} ^http://affordable-leather\.co\.uk
RewriteCond %{SERVER_PORT} ^80$
RewriteRule (.*) http://www.affordable-leather.co.uk/$1 [R=301,L]
Offline
Thanks, but I've just tried that and then checked with both http://www.ragepank.com/redirect-check/ and http://www.axandra.com/free-online-seo- … s-code.php and they both say that the non-www version is reporting a 200 code, rather than a 301:
http://affordable-leather.co.uk returns a 200 (OK) response. PR N/A
http://www.affordable-leather.co.uk returns a 200 (OK) response. PR N/A
200 OK http://affordable-leather.co.uk/
I'm worried that this is going to hit me for duplicate content, so I need to get it fixed.
Offline
I'm not sure why it's not working. Try escaping the dash in the domain name to see if it matches:
RewriteCond %{HTTP_HOST} ^http://affordable\-leather\.co\.uk
RewriteCond %{SERVER_PORT} ^80$
RewriteRule (.*) http://www.affordable-leather.co.uk/$1 [R=301,L]
Offline
Ok, this is getting frustrating!
If I use the .htaccess code below it correctly redirects non-www urls to www but only at the expense of breaking the links to the checkout because it says it's redirecting in a way that will not complete.
I've tried checking for port 80, for not port 443 and for not "secure4.site-login.net/affordable-leather.co.uk" which is the link to the secure section when you go to the checkout etc, but none of that works.
If I take the section starting # Redirect non-www to www address out then the link to the secure checkout etc works, but the site allows non-www urls.
Can anyone please suggest a solution so non-www urls will redirect properly without breaking anything else??
# Turn Rewite Engine On Options +FollowSymLinks RewriteEngine On # Redirect non-www to www address RewriteCond %{HTTP_HOST} ^affordable-leather\.co\.uk RewriteCond %{HTTP_HOST} !^www\.affordable-leather\.co\.uk RewriteCond %{SERVER_PORT} ^80$ RewriteCond %{SERVER_PORT} !^443$ RewriteCond %{THE_REQUEST} !^secure4\.site-login\.net/affordable-leather\.co\.uk RewriteRule (.*) http://www.affordable-leather.co.uk/$1 [R=301,L] # Redirect /shop to /ccp8 RewriteRule ^shop/(.*) http://www.affordable-leather.co.uk/ccp8/$1 [L,R=301] # ATS SEO RewriteRule ^([^/].+)/([^--].+)--(.+)\.html$ ccp8/index.php?app=ecom&ns=prodshow&ref=$3 [L,PT] RewriteRule ^([^--].+)--(.+)\.htm$ ccp8/index.php?app=cms&ns=display&ref=$2 [L,PT] RewriteRule ^([^--].+)--(.+)\.html$ ccp8/index.php?app=ecom&ns=catshow&ref=$2 [L,PT] RewriteRule ^(.*)-(.*)/(.*)\.html ccp8/index.php?app=$1&ns=$2&ref=$3 [L,PT] # Old SEO Rule Rewrites RewriteRule ^ccp8/cat--(.*)--(.*)\.html ccp8/index.php?app=ecom&ns=catshow&ref=$2 [L,PT] RewriteRule ^ccp8/item--(.*)--(.*)\.html ccp8/index.php?app=ecom&ns=prodshow&ref=$2 [L,PT] RewriteRule ^ccp8/page--(.*)--(.*)\.html ccp8/index.php?app=cms&ns=display&ref=$2 [L,PT] RewriteRule ^ccp8/store ccp8/index.php?app=ecom&ns=splash [L,PT] RewriteRule ^ccp8/splash ccp8/index.php?app=cms&ns=display&ref=splash [L,PT] # Version 8 Rewrite Rules RewriteRule ^ccp8/index.php - [L,PT] RewriteRule ^ccp8$ index.php?COREseourl=/ [L,PT] RewriteRule ^ccp8/$ ccp8/index.php?COREseourl=/ [L,PT] RewriteRule ^ccp8/sitemap\.xml ccp8/utilities/sitemap.xml [L,PT] RewriteRule ^ccp8/rss\.xml ccp8/utilities/rss.xml [L,PT] RewriteCond %{REQUEST_URI} ^/ccp8/ RewriteCond %{REQUEST_URI} !\.(xml|css|js|gif|jpg|jpeg|png|pdf)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ccp8/(.*) ccp8/index.php?COREseourl=/$1 [L,PT] # Redirect Item to item and Category to category RewriteRule ^ccp8/Item/(.*) http://www.affordable-leather.co.uk/ccp8/item/$1 [R=301,L] RewriteRule ^ccp8/Category/(.*) http://www.affordable-leather.co.uk/ccp8/category/$1 [R=301,L] # Fix broken link for HAR 32 RewriteRule ^item--(.*) http://www.affordable-leather.co.uk/ccp8/item--$1 [R=301,L] # Fix broken links to xmod reviews RewriteRule ^ccp8/ecom-xmodreviewsf/(.*)\.html$ http://www.affordable-leather.co.uk/ccp8/item/$1 [R=301,L] # Fix broken links to ecom-prodshow RewriteRule ^ccp8/ecom-prodshow/(.*)\.html$ http://www.affordable-leather.co.uk/ccp8/item/$1 [R=301,L] # Fix broken links to email friend RewriteRule ^ccp8/ecom-emailfriend/(.*)\.html$ http://www.affordable-leather.co.uk/ccp8/item/$1 [R=301,L] # Rewrite rule for links to /albums/ RewriteRule ^albums/ http://www.affordable-leather.co.uk/ccp8/ [R=301,L] # Rewrite rule for links to latest RewriteRule ^latest\.htm$ http://www.affordable-leather.co.uk/ccp8/news [R=301,L] # Rewrite rule for link to main RewriteRule ^main\.htm http://www.affordable-leather.co.uk/ccp8/ [R=301,L] # Rewrite rule for link to strapons RewriteRule ^Strap-Ons http://www.affordable-leather.co.uk/ccp8/category/Strap-On_Dildos [R=301,L]
Offline
Your problem is the use of 'secure4.site-login.net/affordable-leather.co.uk' for the URL. Change the cert to 'www.affordable-leather.co.uk' and your .htaccess will work.
Offline
Depends. Ask your host if your .htaccess file will still be able to rewrite URLs when accessed via SSL. If so, you might be able to fork SSL and Non-SSL logic in the .htaccess.
Offline
I am having the opposite problem from this guy but am unsure how to go about it. My security certificate is for "ownajukebox.com" but all my links go to "www.ownajukebox.com". Is there a walk through I can follow to install the security certificate I have into my site? Then after is there any way to rewrite my .htaccess to make all my links pull up through https://ownajukebox.com? Many thanks.
Last edited by LiamEcoRuin (08-20-2014 10:21:26)
Offline
webmaster wrote:
Re-run your software installer (installer.php) and edit the URLs accordingly. That's all that's needed.
I did that and it works great... the second part of what I am asking is if there is edits I can make to my .htaccess sheet to convert all my links before checkout from wwwownajukebox.com/category (example with seo on and .htaccess configured the way it needs to be through the tutorial) to https://ownajukebox.com/category (my SSL certificate is for ownajukebox.com not wwwownajukebox.com) So I was wondering if there is any quick code I could add to my .htaccess that redirects the pages through the secure part of the site so that the entire site is secure even if your not logged in.
Offline
Have a look at the core_namespaces table.
There is a column called hreftype that sets whether a namespace is secure or not.
Changing all the frontend namespaces to SSL from non-SSL should acheive what you want.
or maybe you could just change the core non ssl url through the installer to https.
Not sure if this would work.
Offline
zanart wrote:
Have a look at the core_namespaces table.
There is a column called hreftype that sets whether a namespace is secure or not.
Changing all the frontend namespaces to SSL from non-SSL should acheive what you want.
or maybe you could just change the core non ssl url through the installer to https.
Not sure if this would work.
I will give it a shot by changing the namespaces... Furthermore is there any walkthrough to add canonical tags to the pages? I dont believe Kryptronic has the option to.
Offline
https://forum.kryptronic.com/viewtopic.php?id=31980
Post 5 provides the solution
Offline
zanart wrote:
https://forum.kryptronic.com/viewtopic.php?id=31980
Post 5 provides the solution
Both answers you gave me work mint! The first one, you were correct. Changing it in the installer.php didnt work but changing the namespaces did. Also thank you so much for the canonical forum link. It helped a ton!
Offline
Hi There,
How can I change my site links from : https://bikocartridges.com/ecom-prodshow/BIKO-1569.html to https://bikocartridges.com/BIKO-1569.html?
Thanks
Offline
RewriteRule ^ecom-prodshow/(.*)$ https://bikocartridges.com/$1 [L,R=301]
Offline
Hi Nick,
I Couldn't get it work so I'm now using the default setting. Could you have a look on this as i'm now trying to change :
https://bikocartridges.com/Item/Kodak-8 … k-Ink-Gen4 TO: https://bikocartridges.com/Kodak-895591 … k-Ink-Gen4
Options +FollowSymLinks
RewriteEngine on
###
### Rewrite Non-HTTPS Requests
###
RewriteCond %{HTTP_HOST} ^https://bikocartridges\.com
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^Item/(.*)$ https://bikocartridges.com/$1 [L,R=301]
###
Offline
That rule is only rewriting https requests for URLs starting with /Item. I don't think that's what you wanted to do. Look at the single rule I gave you in post 18 and add as a single rule, after any http->https rewrites.
Offline
Hi Nick,
All I need it is to change the links from: https://bikocartridges.com/Item/pg-540-cl-541-Multipack TO: https://bikocartridges.com/pg-540-cl-541-Multipack.
I've tried the post 18 but it no working so what should I do next?
Thanks
Malindo
Offline
Jeff consulted me concerning a Fresh Eyes Analysis he's working on for your site. Before you make any more changes, ensure you go through your report and look at all the comments regarding SEO. I know you're trying to get things working the way you want them, but the changes you're making are all over the place and really hurting your SEO. Before you do anything further, read the report and get back in touch with Jeff. I really want to work with you on straightening out your SEO via a custom shop job. You've made many conflicting changes, have basically blown away your homepage and have multiple levels of redirects that conflict with each other.
Offline
Pages: 1 2