0

I was wondering how can I fetch all requested links via php and .htaccess

Basically I want that all requests (that is not physically existed as files) will be directed to the index.php

and from the index.php I will echo the displayed request.

so iow :

https://puaction.com/nonexistedpage.php

will go to :

https://puaction.com/404.php

and on 404.php

<?php

$reqpage = /* fetch from htaccess */

echo 'the page : '.$reqpage.' that you requested is not exists';

?>
  • Are you writing your app from scratch using pure PHP? If yes, then consider using a framework, even if you're starting your journey with PHP. Almost every framework supports what you want + many many more! Check out `CakePHP` or `CodeIgniter` - they are great place to start. – ex3v Mar 04 '14 at 12:41

1 Answers1

0

Let's take a look to http://httpd.apache.org/docs/current/mod/mod_rewrite.html and Redirect all to index.php htaccess

:-)

Community
  • 1
  • 1
mfrachet
  • 8,772
  • 17
  • 55
  • 110