is it possible to change URL of webpage using .htaccess and also want to protect folders using .htaccess?

StackOverflow https://stackoverflow.com/questions/16684079

  •  30-05-2022
  •  | 
  •  

Question

I want to change Webpage URL http://www.xyz.com/in/index.php?mpid=page1 to http://www.xyz.com/in/page1 using .htaccess.

And also want to protect my folders with username and password.

Était-ce utile?

La solution

AuthType Basic
AuthName "Protected Area"
#path to htpaswd
AuthUserFile /path/to/.htpasswd
Require valid-user

RewriteEngine on
RewriteCond %{REQUEST_URI} !^in
RewriteRule /in/(.+) in/index.php?mpid=$1
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top