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
  •  | 
  •  

문제

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.

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top