0

at the moment I've got the following code:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

What this code does is allow users to go to /pagename instead of /pagename.php

Is there a way to make it so this only works for a specific page because at the moment this code makes this sitewide?

Logan
  • 61
  • 2
  • 9

1 Answers1

0

add a new RewriteCond after the two rewriteCond and check if the request is for the specific page.

RewriteCond %{REQUEST_URI} ^/(myPage)/

http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

you can also use the RewriteBase directive.

Example How does RewriteBase work in .htaccess

Community
  • 1
  • 1
blejzz
  • 3,349
  • 4
  • 39
  • 60