regex - How to do I write custome apache rules for urls from a view folder and remove the .PHP -


i have literally looked everywhere try , understand apache rules , writing better. trying achieve simple. want leave index.php in root, , each additional page/view want keep them in view directory , views display without .php extension.

the second thing trying achieve however, want keep other pages in view folder, , maybe have folders within keep views organized, display url without /view like: something.com/about not somthing.com/views/about

lastly, if place folders within view, want decide display like: something.com/about && somthing.com/blog/winners

this close have gotten:

<ifmodule mod_rewrite.c>  rewriteengine on  # url renaming rewriterule ^contact$ contact.php [l]  </ifmodule> 

thank in advance!

replace existing rule rule:

<ifmodule mod_rewrite.c>  rewriteengine on  rewritecond %{document_root}/view/$1\.php -f rewriterule ^(.+?)/?$ view/$1.php [l]  </ifmodule> 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -