Solved

How to modify htaccess file for redirect?

Posted on 2013-06-27
6
401 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
Don't Miss ATEN at InfoComm 2017!

Visit booth #2167 to see the  new ATEN VM3200 32 x 32 Modular Matrix Switch. Other highlights include the VE8950 4K HDMI Over IP Extender, VS1912 12-Port DP Video Wall Media Player  and VK2100 ATEN Control System. Register now with Free Pass Code ATEN288!

 
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

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). #…
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

695 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