mod rewrite - Re-writing URLs with an ending forward slash -


i have quick question re-writing urls. pages re-written such

mysite.com/edit.php -> mysite.com/edit/ mysite.com/search.php -> mysite.com/search/ 

along should still able take parameters

mysite.com/edit.php -> mysite.com/edit/?id=2 

this have far doesn't take ending / it's mysite.com/edit

rewritecond %{document_root}/%{request_filename} !-f rewritecond %{document_root}/%{request_filename} !-d rewritecond %{document_root}/%{request_filename}\.php -f rewriterule ^(.+)$ /$1.php [l,qsa] 

also, extra, possible not allow users add .php if tried to? example if had /edit.php , got working /edit/ or /edit , user tried type in /edit.php wouldn't work.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -