473,657 Members | 2,655 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

301 Redirect homepage and specific URLs to new site

1 New Member
Hi Guys,
I'm trying to create an .htaccess file that not redirects the homepage as well as interior pages to the new site.

Here is what I have been trying to use:

Expand|Select|Wrap|Line Numbers
  1. Options +FollowSymLinks
  2. RewriteEngine on
  3.  
  4. Redirect 301 / https://www.newwebsite.com
  5. Redirect 301 /account https://www.newwebsite.com/customer/account/login
  6.  
The homepage works, but the /account URL doesn't. It gets sent to an error page after trying to visit www.newwebsitec om/account

I have lots of pages that I'm attempting to match up with the new site. Any suggestions on how to do this and map them out? Thanks in advance!
Jan 22 '13 #1
2 6415
Luuk
1,047 Recognized Expert Top Contributor
Your 'Redirect lines are wrong....
The '301' need not be there.
(http://httpd.apache.org/docs/current....html#redirect)

To redirect every page that is not found to home, use:
Expand|Select|Wrap|Line Numbers
  1. ErrorDocument 404 http://www.example.com
Feb 9 '13 #2
Jennypliskin
30 New Member
Just try this way:

1. Create an empty text file using a text editor such as notepad, and save it as htaccess.txt.

NOTE:
The reason you should save the file as htaccess.txt is because many operating systems and FTP applications are unable to read or view .htaccess files by default. Once uploaded to the server you can rename the file to .htaccess.
2. Edit the contents of the file. Check the following examples:

301 (Permanent) Redirect: Point an entire site to a different URL on a permanent basis. This is the most common type of redirect and is useful in most situations. In this example, we are redirecting to the "mt-example.com" domain:

# This allows you to redirect your entire website to any other domain
Redirect 301 / http://mt-example.com/

302 (Temporary) Redirect: Point an entire site to a different temporary URL. This is useful for SEO purposes when you have a temporary landing page and plan to switch back to your main landing page at a later date:

# This allows you to redirect your entire website to any other domain
Redirect 302 / http://mt-example.com/

Redirect index.html to a specific subfolder:

# This allows you to redirect index.html to a specific subfolder
Redirect /index.html http://example.com/newdirectory/

Redirect an old file to a new file path:

# Redirect old file path to new file path
Redirect /olddirectory/oldfile.html http://example.com/newdirectory/newfile.html
Redirect to a specific index page:

# Provide Specific Index Page (Set the default handler)
DirectoryIndex index.html
Jun 13 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
4992
by: Ron Howard | last post by:
I am trying to use the following in an ASP page to redirect a user to a non-anonymous FTP site: response.redirect("ftp://myusername:mypassword@ftp.mysite.com") but I keep getting a "permission denied" error. If I just put the same address string in IE6's Address box and go to it, IE opens myusername's FTP home page just fine, so I know the FTP site is working as expected. Also, if I put in an anonymous ftp site, without the username...
4
1659
by: EDOnLine | last post by:
We have a page which, after inserting a record ID to our database via stored proceedure, redirects the user to a URL on a thrid party site which as passed to that page via QueryString. In other words this is an intermediate counting page between the user's click and their arrival at their selected URL. This seems to be working just fine - except when long URLs are passed to the page. In that case we're getting "file not found" errors...
1
1474
by: briain | last post by:
Hi, I am just wondering if anyone knew is it possible to response.redirect to a specific line in another page? - much like you can do in html? If it helps - i am using visual studio 2005 Thank you!! briain
1
1359
by: briain | last post by:
Hi, I am just wondering if anyone knew is it possible to response.redirect to a specific line in another page? - much like you can do in html? If it helps - i am using visual studio 2005 Thank you!! briain
1
1557
by: giodo | last post by:
Hi ALL When we try to get an access to a secure content in a IIS with "Basic Authentication" IE shows a dialog box to set user ID and pass. After correct authentication IE (all browsers) adds a special HTTPHeader for each request: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== where QWxhZGRpbjpvcGVuIHNlc2FtZQ== is Base64("userID:pass")
5
6017
by: Seb | last post by:
Hi, We have a page in VB.NET redirecting to an external site. Example: http://mysite.com/redirect.aspx?url=http//externalsite.com/their-page.asp The target page on the external site (http//externalsite.com/their- page.asp in this example) also redirects to another page (let's say "their-page2.asp") on their website).
1
3077
by: webandwe | last post by:
Hi, Is there a code I can use to redirect a user on a cell phone from one page to another. Basically what I want to do is if a user comes to my website on a cell phone I want to re-direct him to my mobile home page. Thank you.
0
1677
by: peanutgnome | last post by:
Folks, looking for a little guidance on an .htaccess redirect problem - I'm a bit of a newbie when it comes to the rewriting of urls... We've changed from one CMS to another on our company Intranet (Joomla to ModX) and there are three specific URLs that I'd like to have automatically redirect. One of the old addresses was: http://test.com/index.php?option=com_wrapper&view=wrapper&Itemid=54 and the new page is at...
4
3362
by: Mike Gleason jr Couturier | last post by:
Hi, What's a clean way to redirect users on an information page while doing site maintenance... Can we do it with urlMappings !? (wildcard "*"?) Thanks
0
8385
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8303
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8723
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8502
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7316
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.