HTTP status code 301

A place to ask questions and get help. Be the first on your block to post ...

HTTP status code 301

Postby beck » Tue Dec 12, 2006 5:08 pm

I have a couple of pages that are moved permanently

example - http://www.unl.edu/health/CAPS.html

to - http://www.unl.edu/health/students/caps/

I have the temporary meta http-equiv="Refresh" redirect but how do I code for an HTTP status code 301?
beck
 
Posts: 41
Joined: Thu Oct 06, 2005 11:02 am
Location: VCSA

Postby saltybeagle » Tue Dec 12, 2006 5:37 pm

You'll want to add in a file named .htaccess and within that file, place rewrite rules to redirect the users.

Code: Select all
RewriteEngine on
RewriteRule ^CAPS.html$    /health/students/caps/         [R=301]


If you can't get any .htaccess rewrite rules to work, we may need to contact IS to give you permission to override mod_rewrite directives in your .htaccess files.

Give that a try and see if it works.
Brett Bieber
Image
saltybeagle
 
Posts: 376
Joined: Fri Jan 16, 2004 3:10 pm
Location: 321 Admin

Postby saltybeagle » Tue Dec 12, 2006 5:41 pm

Oh, and to verify that the server is sending the correct status codes, you can use a tool like Rex Swain's HTTP Viewer:

http://www.rexswain.com/httpview.html

And verify that you're getting:
HTTP/1.1·301·Moved·Permanently(CR)(LF)
Brett Bieber
Image
saltybeagle
 
Posts: 376
Joined: Fri Jan 16, 2004 3:10 pm
Location: 321 Admin

Postby beck » Tue Dec 12, 2006 6:02 pm

Thanks,

Works great
beck
 
Posts: 41
Joined: Thu Oct 06, 2005 11:02 am
Location: VCSA


Return to Help & Assistance

Who is online

Users browsing this forum: No registered users and 2 guests