Solved

How to modify htaccess file for redirect?

Posted on 2013-06-27
6
395 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
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 6

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 6

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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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.

Join & Write a Comment

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…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now