Redirect advice
-
My website has two versions of the homepage:
http://www.nile-cruises-4u.co.uk/http://www.nile-cruises-4u.co.uk/index.cfmI wondered if I could set up a 301 redirect in the .htaccess file so that only the http://www.nile-cruises-4u.co.uk page was returned as the homepage?Colin
-
Hi Colin,
Sorry for the spelling mistake the first response was off my phone. I have fixed the error (removed the s) in the above answer.
I added the same line to htaccess and you can try the redirection for yourself.
and attached my htaccess as a file for reference.
If you are still struggling I would do the following. Comment out all other code in htaccess temporarily if there is anything (comment by adding # at start of line) to isolate the issue. Ensure that there is no additional white space in the line. EG/ no additional spaces at end of line etc
If you still have no joy, consult your hosting company as they may block htaccess from functioning correctly.
Dan
-
Nope, unfortunately still not working.
Still get the same error message unfortunately.
Colin
-
Thanks Paul, I hadnt' noticed it.
I'll amend it now and give it another try.Thanks Paul and thanks Dan.
Colin
-
Colin, if you just copy and pasted the code Daniel provided, there is a typo in his spelling of your domain name - note the extra "s" at the end of the word "Nile".
If this is the code you're using, the redirect can't work because there is no such page to redirect to (the not redirecting to any url part of the error).
Did you include the typo in the .htaccess entry you created?
Paul
-
Hi Dan,
Thanks very much for that. I've added that to the .htaccess file but whenj I've checked both pages still show.
I checked again via http://www.webconfs.com/redirect-check.php and then I get this error message:
Either http://www.nile-cruises-4u.co.uk/index.cfm is NOT REDIRECTING to any URL or the redirect is NOT SEARCH ENGINE FRIENDLY
I wonder if I've missed something?
Colin
-
Hey Colin,
Highly recommend redirecting the index.cfm Page to /
The easiest way would be;
Redirect 301 /index.cfm http://www.nile-cruises-4u.co.uk/ Check out www.sitepoint.com/htaccess-for-all/ for more details on htaccess. Redirection like this prevents duplicate content, but also improves usability. NOTE: This has been edited to fix the issue highlighted below. Cheers Dan
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
301 redirection help needed!
Hi all, So if we used to have a domain (let's say olddomain.com) and we had a new site created at newdomain.com how do we properly setup redirects page to page. Caveat, the urls have changed so for instance the old page oldomain.com/service is now newdomain.com/our-services on the new site. Do we need to have hosting on the old site? Do we need to setup individual 301s for each page corresponding to the new page? Just looking for the easiest way to do this CORRECTLY. Thanks, Ricky
Intermediate & Advanced SEO | | RickyShockley3 -
Redirect Issue in .htaccess
Hi, I'm stumped on this, so I'm hoping someone can help. I have a Wordpress site that I migrated to https about a year ago. Shortly after I added some code to my .htaccess file. My intention was to force https and www to all pages. I did see a moderate decline in rankings around the same time, so I feel the code may be wrong. Also, when I run the domain through Open Site Explorer all of the internal links are showing 301 redirects. The code I'm using is below. Thank you in advance for your help! Redirect HTTP to HTTPS RewriteEngine On ensure www. RewriteCond %{HTTP_HOST} !^www. [NC]
Intermediate & Advanced SEO | | JohnWeb12
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] ensure https RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] BEGIN WordPress <ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]</ifmodule> END WordPress USER IP BANNING <limit get="" post="">order allow,deny
deny from 213.238.175.29
deny from 66.249.69.54
allow from all</limit> #Enable gzip compression
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 #Setting heading expires
<ifmodule mod_expires.c="">ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType image/x-ico "access plus 1 year"
ExpiresByType image/jpg "access plus 14 days"
ExpiresByType image/jpeg "access plus 14 days"
ExpiresByType image/gif "access plus 14 days"
ExpiresByType image/png "access plus 14 days"
ExpiresByType text/css "access plus 14 days"</ifmodule>0 -
302 redirected URLs - login, account pages
We have a 302 redirection on some of our pages which involved login/account pages. So, some pages are 302 (temporarily) redirected to the login pages which is common especially in e-commerce sites (see screenshot). For SEO practices, what would be best to address this (if this an issue)? a. Block the login/account pages using robots.txt? b. Block the login/account pages using meta noindex? c. Leave them as is since it's a non-issue. d. Other recommendations, please specify in the answers.. Thanks! 2S9xn
Intermediate & Advanced SEO | | jayoliverwright0 -
When is it time to kill 301 redirects
3 months we updated our site design design and as such lots of page urls changed. At the time we 301 redirected about 100 pages. (All pages are on the same domain - 301 redirects like .com/about-us/company to .com/company) Anyhow my question is should I leave these redirects active indefinitely or kill them assuming value has passed through by now? Your Thoughts are welcomed. Thanks, Glen.
Intermediate & Advanced SEO | | AdvanceSystems0 -
Redirection not working
http://elmanarah.com/ to http://www.elmanarah.com/ I have mistakenly created 5 databases for one wordpress installation.In order to get rid of them I mistakenly even deleted the right one.Now created the new one but the URL is showing with www Even now if It type in http://elmanarah.com/ it sends me to http://www.elmanarah.com/ I also check in URL D.A and P.A in OSE it shows like I have redirected it fine.Can anyone Check in and guide me either I have done it right and It pass on my previous work effort or it was total loss for me?
Intermediate & Advanced SEO | | csfarnsworth0 -
Temporary Redirects on Magento
I've recently taken over a client who uses the Magento platform and there was definitely a duplicate issue with his homepage. It redirected www to non www, however the canonical tag was setup wrong and pointing to the www version. When I looked at OSE for both versions the non www has only 7 linking domains and a page authority of 32. The www version has 24 linking domains and page authority of 39. As the domain is fairly new, I decided to redirect the non www to www and keep the canonical the same. (I changed the internal linking structure etc). When I run both URLs through this tool: http://www.ragepank.com/redirect-... it's returning a whole bunch of 302, rather than 301 redirects. What's the deal with that? Is that a Magento setting that I can fix or something a little harder? I'm not sure if it's proper etiquette to post the URL of a client, so if that would help and is OK, please let me know. Thanks
Intermediate & Advanced SEO | | bradkrussell1 -
Is there a way to redirect pages from an old site?
I have no access to an old wordpress site of a client's, but have parked the domain on their new site, gone into webmaster central and requested a change of address and wait... the old domain still shows in the search listings in place of the new site domain and the log files show 404 errors from links to the old site which go nowhere - can anyone suggest a way of managing this on the new site - is there a workaround to what should have been done - 301 redirects on the old site before it was taken down. many thanks
Intermediate & Advanced SEO | | Highlandgael0 -
Redirects 301
Hello guys, I have a doubt. If I reedirect a url with a pagerank of 2 to a new URL, will I loose the PR? My problem is that I have a long url in one page wich is not effective to target a keyword that Im persuing. Im climbing in Google, however I want to 1º place and I dont think that with this long URL I will make it. Advices? Cheers! Pedro M Pereira
Intermediate & Advanced SEO | | PedroM0