Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to modify htaccess file for redirect?

Posted on 2013-06-27
6
Medium Priority
?
409 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:Aaron Feledy
Aaron Feledy earned 1000 total points
ID: 39282275
Use the redirect module:
https://drupal.org/project/redirect
0
 
LVL 7

Accepted Solution

by:
Robert Saylor earned 1000 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

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…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month9 days, 11 hours left to enroll

610 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