0

I have a program that provide step registration1,step registration2. My structure like this:

localhost/bandung/registration.php

then when submit button, the page will send parameter

localhost/bandung/registration.php?user=xxxxxx

Can I change the extention of php to html but still have the parameter like:

localhost/bandung/registration.html?user=xxxxxx
node_modules
  • 4,790
  • 6
  • 21
  • 37
bimasakti
  • 13
  • 2
  • 1
    https://stackoverflow.com/questions/4548860/replacing-php-ext-with-html-through-htaccess – Arun kumar Aug 04 '17 at 07:20
  • 3
    Possible duplicate of [replacing .php ext with .html through .htaccess](https://stackoverflow.com/questions/4548860/replacing-php-ext-with-html-through-htaccess) – Dan Def Aug 04 '17 at 07:25

2 Answers2

0

Create in your bandung folder a new htaccess file. Then add the following lines in it:

# Set Rewrite Engine on
RewriteEngine on

# Create rewrite rule for your registration.php
RewriteRule ^registration.html?user=(.*)$ registration.php?user=$1 [R=301,L]
node_modules
  • 4,790
  • 6
  • 21
  • 37
0
RewriteRule ^(.*)\.php $1.html [R=301,L]
RewriteRule ^(.*)\.html $1.php

edit after pulling white rabbit out of the hat

RewriteEngine on  
RewriteBase /

RewriteCond %{THE_REQUEST} (.*)\.php  
RewriteRule ^(.*)\.php $1.html [R=301,L]  

RewriteCond %{THE_REQUEST} (.*)\.html  
RewriteRule ^(.*)\.html $1.php [L]
Arun kumar
  • 1,535
  • 3
  • 12
  • 17