Jump to content

Mode Rewrite Rule to Identify an URL Pattern 404 the request?


natasha_thomas

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.