0

My link looks like this:

<a href='/contact'>Contact Us</a>

The web server needs to display the contents of the page /contact.php WITHOUT redirecting.

Essentially, hiding filenames.

What do I add to .htaccess to achieve this?

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
pixelFast
  • 9
  • 2
  • This has not been answered for my purposes. I'm trying to replace/hide filenames completely, with /someotherfolder that may NOT match the base filename. For example: mysite.com/contact should display the contents of mysite.com/assets/contact-us.php Similarly, and ideally, if someone browses to mysite.com/assets/contact-us.php, I would like a redirect to mysite.com/contact. This will require a new rule for each specific file, I realize. But I haven't got anything to work. – pixelFast Sep 13 '22 at 01:34
  • Whilst you state "Essentially, hiding filenames", your example is not doing that; it is simply hiding the file extension. Please give an example of "hiding filenames". – MrWhite Sep 13 '22 at 01:34
  • Please update your question with your example of "hiding filenames" as this completely changes your original question. Also include the directives you have tried (in fact, your complete `.htaccess` file) and what happens exactly... do you get an error, undesired result, _nothing_? What you are trying to do requires a single rule, again something which has been answered many times - so why do these answers not work? Have you confirmed that `.htaccess` overrides are enabled etc.? – MrWhite Sep 13 '22 at 01:38

0 Answers0