301 or 404 redirect? - apache

One of my websites is constantly being scanned for WordPress directories and files. This particular site never had or will have WordPress. If it did then I would follow the standard practices outlined at Hackertarget to prevent getting hacked.
There currently is a blank 404 page for the site (not really user friendly, but that's the point). This does not seem like the best option so I am considering using either an internal 301 redirect or possibly redirecting any requests for /wp/*, /wordpress/*, etc..., over to WordPress.org.
A similar question was asked, but I am not concerned about SEO and those answers do not address this particular scenario.
So, which is best?
1. Keep the blank 404.
2. Internal 301.
3. External 301.

The 404 response is certainly the standard. Any of the 300 codes will just divert the traffic to another site, which would be rude on your part. If you are being scanned, don't expect the scanner to take heed of the "permanence" of your 301 response. Please, go with the 404.

Related

htaccess 301 redirect - how to disable it?

I have added 301 redirect on my website by mistake (because I was doing maintenance). Now lots of people can't get back to my website, because they are still redirected to other page - eventhough I removed redirection (even deleted htaccess). As much as I searched around it's because htaccess (or 301 redirect) is cached in users browser and I wasn't able to find any solution for this. Is there any way to fix this, I can't just loose hundreds of visitors because of something like this?
This page explains what is going on in good detail:
301 Redirects: The Horror That Cannot Be Uncached
Basically, modern browsers cache the redirect response for 301 for some indeterminate amount of time and will not make an updated request to your old web page to refresh it. Users can manually clear the cache and, because it is a cache, data can be purged if the browser needs more space for other data (like other redirects).
This SuperUser question resolves the caching issue from the client's end:
How can I make Chrome stop caching redirects?
One interesting answer is:
//superuser.com/a/660522/178910
In this answer, the user points out that the browser treats http://example.com/ and http://example.com/? as two different URLs. You could go to the "new" site and setup an HTTP 302 redirect pointing back to the original page with a ? on the end and it should load. If they original page already had a query as part of the URL, you can simple add an & to the end to achieve the same result.
It's not perfect -- it is a different URL after all -- but at least they'll be able to view your old site.
Note that your web application may try to redirect empty queries or invalid queries back to a "clean" page, which you may have to disable to get the intended result.
UPDATE
One other option is to put a redirect from the new site back to the old site (make this a 302 or 307 redirect to avoid the 301 problem you're currently having). From my testing, Chrome will remove the old redirect when it does this. It may throw a "redirect loop" error, but only once. I was unable to reproduce the cached redirect problem at all with the latest version of Firefox. Other browsers' behavior is probably going to be inconsistent.

SEO - 301 redirect via 404 page

I am new to this so I will try to explain myself clearly.
I am doing my 301 redirect from a custom 404 page. Now I got it working my question is more regarding how google would treat this. Cause we going to a 404 page would google just record it as a 40 page or would it actually record the 301? As i said I am new to this and have looked through google to try and find an answer to this.
Anyway any help or comment would be greatly appriciated. thanks in advance
Best practice in this case could be:
If the page doesn't exist, but we have new one, with highly similar content, we can make 301 redirection, simply saying: "Moved permanently", which is instructing Google to actually take new URL on account and prioritize it.
If the page doesn't exist, and we actually have no idea why someone could type this link, as this URL never existed and is just wrong, then we serve 404 "Not Found". It simply means that the URL is wrong, and someone (or some other website) has fooled you to follow this link. You shouldn't automatically redirect user from this page, but place a link to the homepage instead, so user can choose his action.
If the page doesn't exist, and we know that we had this page, but it doesn't exist, and it will not exist in the future as well (we has simply decided that we will no longer have this page), then serve 410 "Gone" page, with a link to homepage as well, and let user decide.
HTTP codes, are not just a theory, it's a standard we should use. I noticed, that many 404 pages are served without correct HTTP response code, which only suggests that there is a poor development behind it.
More about HTTP response codes here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
From my understanding, a 301 redirect is the best way to retain "link juice" and should be used if the 404 page is referencing has a lot of external links, has substantial traffic, etc.
Sending a generic 404 page straight to the home page is not ideal, as it may confuse the user. Allowing the 404 keeps the page from being repeatedly indexed and crawled by search engines.
Read more about it here: http://moz.com/learn/seo/http-status-codes.
it is not ok to redirect 404 page to another. it's better to correct it and show the old page. if it's impossible you should show 404 page and put some helpful links in it.
if you want to redirect to the correct one it's ok but the best way is to show display original page regardless of duplication. but you must use rel canonical to tell search engines where is the correct version on the page.
https://support.google.com/webmasters/answer/139394?hl=en

Will IP Masking effects SEO Results / Ranking?

When users entering domain www.example.com, it has to check for the country from the IP and should redirected to some other language specific domain eg: www.example.co.in. Will the search engine crawler recognize both www.example.com and www.example.co.in? Will this effect the search engine ranking?
Someone could guide me on the disadvantages of using IP masking.
Thanks & Regards,
Kavitha
I think it is interesting to note that Google returns HTTP/1.1 302 Found to redirect you to your country specific domain when you visit google.com from any country outside the US.
I suggest reading Matt Cutt's article (a Google software engineer) on how Google handles the 302 Redirect: SEO advice: discussing 302 redirects.
Different search engines handle the 302 redirect in a different way. Google also makes a distinction between redirects towards the same domain, and off-domain redirects. In general, using redirects will make your SEO more complicated and very tricky, and you risk having your original domain ignored by search engines.
You may also want to check out the following article on how the Google crawler handles the various HTTP status codes: Google Webmaster Central - HTTP status codes.
HTTP/1.1 302 Found code is used for temporary redirects, so it could work. However, it is not recommended as Google will be unable to identify domain example.com with any content at other domains - basically, what I am saying is that Google spider will be redirected too based on its IP and only (presumably) English content will be indexed for this domain. If that's OK with you, then you are set.
Please, be advised this is a big no-no(!) from usability perspective and users everywhere hate this behaviour. Google offers alternative link to go to google.com even after redirection.

SEO / Page Rank considerations for website redesigns

We have done many website redesigns before for companies looking to bring themselves into the 21st century. Most of them have low page rank when we are handed the project, so it is usually not a big concern of ours to maintain page rank.
However, we have recently obtained a client that is coming from a PHP-based architecture (we are a Microsoft .NET house), and one of the client's main concerns is the loss of their google page rank. Obviously the pages that have a high page rank have PHP extensions.
My questions are as follows:
Will a 301 redirect maintain page rank for each page, or is there something else we need to consider?
Since there are hundreds of pages, is there a nice "industry-standard" way of performing multiple 301 redirects? We are thinking of doing some URL rewriting of the PHP pages and performing the 301 redirect in the web form that we're redirecting to, but before we do this, we want to make sure there's not a better/cleaner way to do this.
Are there any other considerations we should take into account when dealing with a site of this magnitude with this amount of SEO success?
Any help, as always, is appreciated!
A 301 is the recommended way (straight from Google's Webmaster Tools documentation) of changing URL's for content. It is the "industry standard" and correct way of performing this task.
Your question is actually very similar to this one, so you could check there for some more relevant responses.
Look into the .Net Routing module. It would be a cleaner way to manage all those redirects in one go and in one spot.
You may have to set up IIS to send .php files to .Net
Yes, 301 redirects maintain the authority of a website or a page for SEO. (Most tests show that 90% or more of the old authority is passed).
One other related search engine optimization tip is to be sure that each page redirects / resolves only one time. i.e. not as a www & non-www or with a trailing / and without.
301
Redirect is Google Friendly and also Maintain Page Rank in Google. and second thing Web redesign is Best decision for Increase Page Rank and also Site Health.

Is 301 the correct redirect code for "fake" subdomains?

My site assigns each user a fake subdomain along the lines of
http://username.mysite.com/
which redirects to
http://mysite.com/shop/username
The second link is the one used internally, is assigned as link rel="canonical", and what I want to display in the browser as the correct url, the subdomain is basically just a convenience for my users.
The question is whether 301 is appropriate in this scenario? A 301 redirect is used for a link that now points elsewhere permenantly, which implies that the old link is deprecated. My concern is that I will attract bad SEO juju by using a 301 redirect whilst still advocating / promoting the use of the old link.
Yes, 301 is the correct choice here as search engines will index the final URL rather than the subdomain. I've never heard of any penalty for having too many 301 redirects. Other redirect types less accurately described what you're looking for (temporarily moved, etc.).