.htaccess Redirection Issue

Discussion in 'Apache' started by devjeetsingh, Feb 15, 2013.

  1. #1
    Hello DP,


    Hope you all are doing well. I'm facing htaccess redirection issue with one of my website http://www.jets-corp.com . A new pages automatically generated when you type anything after .php (it is applicable for internal pages only). For example, if we take the URL http://www.jets-corp.com/emptylegs.php and type anything after .php (for example /jhgduhygh.php), another page does appear: http://www.jets-corp.com/emptylegs.php/jhgduhygh.php

    I want to fix it through .htaccess redirection(actually I want to redirect all such pages to the home page or better at their root page) or suggest me if there is other way to fix the same.

    I would appreciate your suggestion to fix the issue.


    Thanks and Regards,
     
    devjeetsingh, Feb 15, 2013 IP
  2. pr0t0n

    pr0t0n Well-Known Member

    Messages:
    243
    Likes Received:
    10
    Best Answers:
    10
    Trophy Points:
    128
    #2
    That sounds odd. Perhaps something like this can help:
    RewriteEngine On
    RewriteBase /
    RewriteRule ^([^/]+).php/([^/]+)$ /$1.php? [L,R=301]
    Code (markup):
    Cheers!
     
    pr0t0n, Feb 28, 2013 IP