0

I need some help figuring out how to write this .htaccess.

My file is in mywebsite/part5/thanksfordownload.html. How to use .htaccess to have url mywebsite/thankyoufordownload.html?

I tried using this for the .htaccess but no dice. I tried uploading it both in the root and in the folder itself.

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ /part5/$1 [L]

Not sure what went wrong in this part, thanks for your views & comments in advance!

2 Answers 2

3

Ok so basically if you only want that rule - you'd want to do something like this -

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^thankyoufordownload.html$ /part5/thankyoufordownload.html [L]
Sign up to request clarification or add additional context in comments.

2 Comments

@zer - yes :) Caught that just after I posted.
argh, cannot strike text in comments :-S +1
1

Simply:

RewriteRule ^thankyoufordownload.html$ part5/thanksfordownload.html

This will only work for the example asked about.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.