301 Redirect Code

Where is a good resource for finding code examples for 301 redirect?

Well 301 redirects are code agnostic… you can implement them through a variety of languages. Just do a Google search for “Java 301 redirect code example” or “C# 301 redirect code example”. You don’t even need code… you can setup 301 redirects using .htaccess files or through Apache/Nginx configurations.

What are you working on?

I’m looking for .htaccess redirect

Well below is how to setup a 301 redirect for inmotion hosting and the thoughts presented here will work on many hosts and platforms.

You can also find tons of examples at the following github repo…

I hope these help.

If you can do redirects in other ways, it may be speed benefits. “for .htaccess to work Apache needs to check EVERY directory in the requested path for the existence of a .htaccess file and if it exists it reads EVERY one of them and parses it. This happens for EVERY request.” credit to this site.

I had several redirects on my old site and I was not aware of this. And the old site was terribly slow. Every speed enhancement counts IMHO. In my new site I redirect using server code.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.