Your original rewrite rule contains an explicit redirect via R=301
. That flag will need to be removed. Secondly, the right-side of the RewriteRule
(the target) include http://example.com/
which will also force a browser redirection implicitly. Instead, use just the relative path on the right side:
RewriteEngine On
RewriteBase /
RewriteRule ^connect/admin/create$ connect/admin/create.php [L,NE]
This can be done in a more generic way if you will also have additional actions inside connect/admin
from which you'd like to strip the .php
:
# Capture the action into $1 and pass it to the redirect target.
RewriteRule ^connect/admin/([^/.]+)/?$ connect/admin/$1.php [L,NE]