Solved

Rewriting a file path with htaccess

Posted on 2014-02-03
4
287 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
[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
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
Martin Tarlink earned 250 total points
ID: 39831447
------------ .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
ID: 39831542
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
ID: 39831545
Sure
rewriterule ^RezEasy/Availability.htm(.*)$ http://mauitradewinds.com/RezEasy/availability.html $1 [r=301,nc]
0
 

Author Comment

by:ddantes
ID: 39831552
Thank you!  

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

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
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). #…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

705 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