natasha_thomas Posted August 19, 2010 Share Posted August 19, 2010 Folks, I want a mode_rewrite Rule in .htaccess that will match the URL requested and if the URL requested has structure like the below: http://www.abc/anything/anything.htm www.abc/anything/anything.htm abc/anything/anything.htm It should return a 404 Error page. May i request you to help me with the Rules for the above Logic? Best Regards, Natasha Thomas Quote Link to comment https://forums.phpfreaks.com/topic/211179-mode-rewrite-rule-to-identify-an-url-pattern-404-the-request/ Share on other sites More sharing options...
nadeem Posted August 19, 2010 Share Posted August 19, 2010 RewriteEngine On RewriteCond %{REQUEST_URI} ^(.*)whatever\.php$ [NC] RewriteRule ^(.*)\.php$ http://non_existent_path.html [R,L] Quote Link to comment https://forums.phpfreaks.com/topic/211179-mode-rewrite-rule-to-identify-an-url-pattern-404-the-request/#findComment-1101236 Share on other sites More sharing options...
natasha_thomas Posted August 19, 2010 Author Share Posted August 19, 2010 RewriteEngine On RewriteCond %{REQUEST_URI} ^(.*)whatever\.php$ [NC] RewriteRule ^(.*)\.php$ http://non_existent_path.html [R,L] Dear Nadeem, This Rule is not achieving on what i am looking for. I appreciate your efforts though. If you observe the URL structure i have shared in my First post, i am sure, you can come up with the perfect Codes. I am waiting!!! Best Regards, Natasha T Quote Link to comment https://forums.phpfreaks.com/topic/211179-mode-rewrite-rule-to-identify-an-url-pattern-404-the-request/#findComment-1101295 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.