I am adding a new application to my site at example.com/app. I want views at that URL to always open myapp.php.E.g.example.com/app -> example.com/app/myapp.php andexample.com/app/ -> example.com/app/myapp.phpWhat's the correct form of rewrite rules in the .htaccess file?I've got:<IfModule mod_rewrite.c>RewriteEngine OnRewriteBase /app/RewriteRule ^myapp\.php$ - [L]RewriteRule ^myapp.php$ - [L]RewriteRule . - [L]</IfModule>...based on what the Wordpress front-end does. But all I see at example.com/app is a directory of files. :((I put those rewrites at the top of my .htaccess file).Any ideas?UpdateWhat actually worked:RewriteEngine OnRewriteBase /RewriteCond %{REQUEST_URI} ^/app(/.*)?$ [NC]RewriteCond %{REQUEST_FILENAME} !-fRewriteRule . /app/myapp.php [L]This is good because:Explicit or implicit calls to app/myapp.php work.example.com/app redirects to app/myapp.phpexample.com/app/ redirects to app/myapp.phpexample.com/app/subfunction redirects to app/myapp.phpAll other calls to example.com/otherstuff are untouched.Item 4 is Wordpress-like Front Controller pattern behaviour.I think that rule RewriteCond %{REQUEST_URI} ^/app.*$ [NC]needs refining as it allows /app-oh-my-goodness etc. through too.Thanks for the answers.
.htaccess rules to rewrite URLs to front end page?
htaccess;mod rewrite;web applications;url rewriting