Solved

Rewriting a file path with htaccess

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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to configure and install nginx ? 1 461
Problem with .htaccess file 4 70
Apache Issues 9 80
.htaccess file settings 4 57
Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

786 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