I know nothing about these files but I am trying to do a 301 redirect from http://jbosolutions.ollysguitar.com/blog to it's correct address http://www.jbosolutions.co.uk/blog Both are indexed by Google and I want to eliminate duplicate content. Thanks a lot
RewriteEngine On RewriteCond %{HTTP_HOST} ^jbosolutions.ollysguitar.com/blog [NC] RewriteRule ^(.*)$ http://www.jbosolutions.co.uk/blog/$1 [L,R=301] PHP: wrong section though!!
@protocol, the path is not part of the host. Also, you do not need to check the host in this case as two URLs don't share the same web root. RewriteEngine On RewriteRule ^/blog(.*)$ http://www.jbosolutions.co.uk/blog$1 [R=301,L] Code (markup):
Ok I have tried both of these combinations in both the .htaccess of jbosolutions.co.uk and ollysguitar.com and neiter seem to work protocol96 - this coverts http://www.jbosolutions.co.uk/blog to http://jbosolutions.ollysguitar.com which is teh opposite of what I was hoping for. krt this did not seem to make a difference in either of the files. Hoping for an answer
With reference above - Is there any rule where these need to go in the .htaccess file as I have just been inserting it anywhere? Thanks a lot
RewriteEngine On RewriteCond %{HTTP_HOST} ^jbosolutions.co.uk/blog/ [NC] RewriteRule ^(.*)$ http://www.jbosolutions.ollysguitar.com/blog/$1 [L,R=301] PHP: try this and lemme know!
I tried this and still the same. Something strange is going on as it I take everything out of the htaccess file relating to this and visit www.jbosolutions.co.uk/blog it transfers me to http://jbosolutions.ollysguitar.com What else could it be? Thanks
it seems like there could be something to do with the / at the end as I can go to http://www.jbosolutions.co.uk/blog/ but not to http://www.jbosolutions.co.uk/blog ? thanks
Remember to put this in the htaccess for jbosolutions.ollysguitar.com only, not both sites: RewriteEngine On RewriteBase / RewriteRule ^blog(.*)$ http://www.jbosolutions.co.uk/blog$1 [R=301,L] Code (markup): Also, when it doesn't work, please be a bit more specific. Does it give a blank page, a 404 error, a 500 error, does it stay at the old host URL etc.
Hi Thanks Here is my .htaccess in jbosolutions.co.uk Options +FollowSymlinks RewriteEngine on rewritecond %{http_host} ^jbosolutions.co.uk [nc] rewriterule ^(.*)$ http://www.jbosolutions.co.uk/$1 [r=301,nc] RewriteEngine On RewriteBase / RewriteRule ^blog(.*)$ http://www.jbosolutions.co.uk/blog$1 [R=301,L] # Eliminates duplicate home page i.e.: www.domain.com/index.php and www.domain.com appear as duplicate home page RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ RewriteRule ^index\.php$ http://www.jbosolutions.co.uk/ [R=301,L] Code (markup): This seems to have no effect - this is currently how I will leave the .htacess file so you can see what it does. I have a jbosolutions.co.uk directory. In here I have changed the .htaccess
I don't have a web root for jbosolutions.ollsguitar.com - With my host I have ollysgutar.com as a primary domain then all the others are within folders under that domain like jbosulitons.co.uk. there is no other folders.
I asked my host and they said its the way Cpanel choose to do it. I have only a webroot for ollysguitar.com then within this folder is the webroot for jbosolutions.co.uk along with my other websites.