Solved

Rewriting a file path with htaccess

Posted on 2014-02-03
4
268 Views
Last Modified: 2014-02-03
An unexplained glitch with my web host sometimes misdirects page requests to an incomplete path, resulting in visitors getting an error 404.  To avoid that, I'd like to use an .htaccess file.  Can you provide code for that file, which will perform the following rewrites:

1. www.mauitradewinds.com/RezEasy/Availability.htm  to www.mauitradewinds.com/RezEasy/availability.html    (change in case is intentional)

2. www.mauitradewinds.com/RezEasy/bf0001.html to
www.mauitradewinds.com/RezEasy/0001/bf0001.html

3. www.mauitradewinds.com/RezEasy/av0001.html to
www.mauitradewinds.com/RezEasy/0001/av0001.html

Would I place this .htaccess in the RezEasy folder?

Thank you.
0
Comment
Question by:ddantes
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
Martin Tarlink earned 250 total points
Comment Utility
------------ .htaccess file---------------------
Options +FollowSymlinks
RewriteEngine on
rewriterule ^RezEasy/bf0001.html(.*)$ http://mauitradewinds.com/RezEasy/0001/bf0001.html$1 [r=301,nc]
rewriterule ^RezEasy/av0001.html(.*)$ http://mauitradewinds.com/RezEasy/0001/av0001.html$1 [r=301,nc]

--------------------------------------------
Put  .htaccess in the root folder /


THis is good online generator http://www.webconfs.com/htaccess-redirect-generator.php

You can test it here http://htaccess.madewithlove.be/


Here you can build own http://www.htaccessredirect.net/
0
 

Author Comment

by:ddantes
Comment Utility
Thank you for your comment, which appears to cover items #2 and #3 in my question.  Could you also include code to rewrite item #1?
0
 
LVL 5

Expert Comment

by:Martin Tarlink
Comment Utility
Sure
rewriterule ^RezEasy/Availability.htm(.*)$ http://mauitradewinds.com/RezEasy/availability.html $1 [r=301,nc]
0
 

Author Comment

by:ddantes
Comment Utility
Thank you!  

Did you happen to try navigating in our online booking system and encounter a 404 error?
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

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). #…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 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

8 Experts available now in Live!

Get 1:1 Help Now