0

I've a joomla website. Recentley I added a subdirectory to the root of the website which contains some pages which are not linked to the CMS in any way.

I wanted to remove the .php from the end of these pages as I was going to promote them over social media and wanted the URL's to be easier for users to remember.

The page in questions is:

http://www.mytestwebsite.com/share/thepage.php

So I added the following rule to my .htaccess file:

RewriteRule ^/share/thepage?$ /share/thepage.php  [NC]

With the hopes that the URL would be http://www.mytestwebsite.com/share/thepage and still load thepage.php but it's not working.

Javacadabra
  • 5,417
  • 14
  • 77
  • 151

1 Answers1

1

Use:

RewriteEngine on 
RewriteRule ^share/thepage/?$ /share/thepage.php  [NC,L]

No leading / in the first RewriteRule argument in htaccess.
And /? is for the optional trailing slash (not optional e with e?)

Croises
  • 18,518
  • 4
  • 28
  • 46