Solved

How to modify htaccess file for redirect?

Posted on 2013-06-27
6
400 Views
Last Modified: 2013-08-12
The old site was .asp and the new site runs on drupal.

I want anyone who went to http://www.site.com/aboutus.asp to now be redirected to http://www.site.com/about
htaccess.txt
0
Comment
Question by:sandshakimi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 13

Assisted Solution

by:Arrow_1
Arrow_1 earned 250 total points
ID: 39282275
Use the redirect module:
https://drupal.org/project/redirect
0
 
LVL 7

Accepted Solution

by:
Robert Saylor earned 250 total points
ID: 39282486
RewriteEngine on
RewriteCond %{HTTP_HOST} ^redirecttest\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.redirecttest\.com$
RewriteRule ^aboutus\.asp$ "http\:\/\/www\.redirecttest\.com\/
0
 
LVL 7

Expert Comment

by:Robert Saylor
ID: 39282491
sorry, copy and paste error use this:


RewriteEngine on
RewriteCond %{HTTP_HOST} ^redirecttest\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.redirecttest\.com$
RewriteRule ^aboutus\.asp$ "http\:\/\/www\.redirecttest\.com\/about" [R=301,L]
0
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 
LVL 12

Expert Comment

by:junipllc
ID: 39283146
Another option is to put one of these for each page you need to redirect, if you actually do want to use .htaccess. Otherwise the Redirect module (as mentioned above by the famous Arrow_1) is the way to go.

Redirect permanent /aboutus.asp /about

Open in new window


Cheers,

Mike
0
 

Author Comment

by:sandshakimi
ID: 39283684
I thought the redirect module would be the right approach also, but on the URL redirects config. page, the from address is http://www.mysite.com/?q=

I guess because clean URL was never enabled ?
0
 
LVL 15

Expert Comment

by:Insoftservice
ID: 39361332
mod_rewrite has to enable in apache server

RewriteEngine on
RewriteRule ^([a-z]+)/([a-z\-]+)$ /$1/$2.asp [L]


Please try out this one

http://lovetomarry.com/weblog/archive.asp
http://lovetomarry.com/etc/colophon.asp

to

http://lovetomarry.com/weblog/archive
http://lovetomarry.com/etc/colophon
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question