Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.