Solved

How to modify htaccess file for redirect?

Posted on 2013-06-27
6
399 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

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.

Question has a verified solution.

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

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
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…

763 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