Solved

Rewriting a file path with htaccess

Posted on 2014-02-03
4
282 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

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!

Question has a verified solution.

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

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…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

739 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