• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 253
  • Last Modified:

Setting up 301 redirects for several pages

I'm converting a few of my sites to a CMS and so the page URL's will be different. I don't want to leave the old files on the server because clutter drives me batty.

So, how do I setup a 301 redirect in the .htaccess and make it point to the new page?

for example:

one of my old pages is /setting_up_ad-hoc_networking.html now it's path is /articles/networking/setting-up-ad-hoc-networking

I've got several to do. This should be a doozy.
0
Sootah
Asked:
Sootah
  • 3
  • 2
1 Solution
 
SootahAuthor Commented:
I see the commands, but I don't know how to format them.

How do I take url.com/setting_up_ad-hoc_networking.html and make it into url.com/articles/networking/setting-up-ad-hoc-networking via the mod rewrite?
0
 
ahoffmannCommented:
Redirect permanent /setting_up_ad-hoc_networking.html  /articles/networking/setting-up-ad-hoc-networking

Note: to be RFC-compliant you better use a full URI with schema and FQDN rather than just the path in the target
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
SootahAuthor Commented:
0
 
SootahAuthor Commented:
And why are relative paths a bad idea?
0
 
ahoffmannCommented:
Redirect permanent /setting_up_ad-hoc_networking.html  http://url.com/articles/networking/setting-up-ad-hoc-networking
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now