Rushil Pachchigar Rushil Pachchigar - 1 month ago 9
Apache Configuration Question

Php name change using htaccess not working

I'm using this htaccess rule for change the php page name but its not working.

I want login page name change to hello and the final link will be https://www.cloud9cumulus.com/shieldpayments/view/hello but it's have to consider the original(login) page code.

RewriteEngine On
RewriteRule ^hello\.php/([0-9]+)/?$ login.php?vp=$1 [L,QSA,NC]
#this rule for removing .php extension
<IfModule mod_rewrite.c>
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{THE_REQUEST} \s/+(.+?)\.php[\s?] [NC]
RewriteRule ^ /%1 [R=302,NE,L]
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{THE_REQUEST} /index\.php [NC]
RewriteRule ^(.*)index\.php$ /$1 [L,R=302,NC,NE]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [L]
</IfModule>

Answer
#for restrict that file     
<Files "login">
        Order Allow,Deny
        Deny from all
    </Files>
#https://www.cloud9cumulus.com/shieldpayments/view/login.php to https://www.cloud9cumulus.com/shieldpayments/view/782783
RewriteRule ^shieldpayments/view/782783$ shieldpayments/view/login.php

i hope this will work for you.