Solved

Rewriting a file path with htaccess

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
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). #…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

756 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