php - .htaccess redirect from directory to page -


i have line in htaccess file

redirect /popin http://www.mysite.com/category.html 

so if 1 enters http://www.mysite.com/popin redirecting http://www.mysite.com/category.html

but if type url :

http://www.mysite.com/popin/ redirecting not found page last slash @ end of url redirecting not found page

i want make change in htaccess file such if enters www.mysite.com/popin or www.mysite.com/popin/ should redirect

www.mysite.com/category.html 

try one:

rewriteengine on rewriterule ^/?poppin/?$ http://www.mysite.com/category.html [l] 

it uses ? regular expression operator on / make rewrite rule match /poppin /poppin/.

you can experiment directoryslash directive.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -