Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-19-2011, 04:57 PM   #1
LQ Newbie
Registered: Mar 2011
Posts: 1

Rep: Reputation: 0
301 Re-direct Question

Hello All,

I am not sure if this is the best place to post this question but here goes anyways.

I have recently built a new website using Apache and PHP based extensions. My old website was the .aspx extension. We have recently transferred our old site to the new site and I am now finding out that all of the pages listed in the search engines ending with .aspx are coming up with errors because it does not match the new website links. I am not totally familiar with 301 redirects I am familiar with the .htaccess file.

What I'm looking for is some help on how to make it so when somebody clicks on one of the old search engine links from the older domain that will transfer to the newer domains index page. Please note that the actual website name has stayed the same it's just the link.aspx or whatever the older link was doesn't match to the new site. I am not sure whether I'm supposed to be putting coding in the current websites HT access file or the older sites HT access file.

Basically at this point what am looking to do is if anybody clicks on any one of the older links ending in .aspx, that they will be transferred to the home page which is the index file of the new and current website. Here is an example of a bad link out there:

The older website, a specific link was When somebody clicks on that link, they get a search engine error because that link does not exist anymore. The actual link to that page on the new website is

Can anyone offer any assistance on the best way to do this. Right now if you do a Google search or a web search engine search there are dozens of pages with our old links on their with which does not lead anywhere but to an error page. I'm looking for when somebody clicks on one of those older links from a search engine that will go to the default index page of the current website listing.

Thanks for any assistance that you may be able to offer I do appreciate it very much.
Old 04-04-2011, 04:23 PM   #2
Registered: Jun 2009
Location: Maryland
Distribution: Fedora, CentOS, RHEL, Ubuntu
Posts: 41

Rep: Reputation: 3
In your http.conf (or whatever) add lines like these.
redirect 301 /6adam.aspx
This will suck if you have a lot of redirects but I don't see any patterns that you would be able to use to rewrite the URLs based on rules. Check out the Apache documentation as well as it's pretty user-friendly.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error 301 in apache adekoya_sola Linux - Server 2 07-07-2009 10:46 AM
htaccess 301 rewrite BillKat Linux - Server 2 04-07-2009 01:54 PM
No Direct Question, Generally Lost & In Need Of Assistance sodredge Linux - General 8 10-20-2008 02:27 AM
Skytone RST-301 oddiofile Linux - Hardware 1 08-25-2008 03:59 PM
cannot get 301 redirect to function geoman Linux - General 4 01-17-2006 09:23 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:35 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration