Hope this helps Try changing the expression from ^(.*)$ to ^([^/]+)/?$, which means: the entire thing must not contain a / unless it's at the end. Note that the URI is stripped of its leading slash when you match against it in htaccess files.
404 url not found when directory location moved (htaccess)
wish helps you The problem with you're current config, is that it always does the first rewrite if the file doesn't exist and the second rewrite never get's executed. You will need to check for existence of the file before doing the redirection such as below
it helps some times I have probably a rather simple mod_rewrite question, however I didn't know how what to google for and how to do this in the best way. , You can use this code in your DOCUMENT_ROOT/.htaccess file:
RewriteRule ^directory/(.+?\.php)$ /$1 [L,NC]
After modifying my .htaccess file to hide the .php extension from the URL, some directory items are unable to be found
Hope that helps Recently, I got some help modifying my .htaccess file to hide the .php extension in the url. After I got it working, a few bugs occurred with my site. For whatever reason, any php page in a sub directory returns a 404 error. For example: , Try these rules in your root .htaccess: