0

.htaccess is now a very common URL rewrite to make it SEO friendly and cover the database IDs.

What are the ways to explore php file on the server given to URL via .htaccess?

Example : The URL is www.domain.com/news/56.

I expect to find news.php?id=56 i.e. www.domain.com/news.php?id=56

Jack
  • 1

1 Answers1

1

No, there is no way for you to find this.

The reason for this is that rewrite rules are not visible to the client, as they are performed server-side. You further cannot be sure whether or not it is a simple rewrite, or if the whole HTTP request is handed over to a complex web application, which parses the route to determine which class and method sends the response.

  • 2
    Although most are asking for help with their "`.htaccess` problems" on SE, making their rewrite rules all publicly available. ;) – Esa Jokinen Apr 23 '20 at 12:24
  • Precisely, Esa. I am aware that the .htaccess is performed at the server-side but I am here to explore options, not to read .htaccess clean but figure it out how to reach the PHP file. Maybe a script to check? – Jack Apr 23 '20 at 12:54
  • @EsaJokinen do .htaccess files still see widespread use? – multithr3at3d Apr 23 '20 at 13:01
  • @multithr3at3d: There are two possibilities: either they are still mainly used despite it's clearly not recommended by the [`.htaccess` documentation](https://httpd.apache.org/docs/2.4/howto/htaccess.html) itself... or anyone who has grown out of `.htaccess` won't keep asking any questions as they already know what they are doing. (Or, in worst case scenario, most of the administrators have no clue what they are doing.) – Esa Jokinen Apr 23 '20 at 13:14