1

I wanted to achieve url like this

www.abcd.com/somename

We know that the folder does not exist on the server and will throw 404 immediately

But I'm looking forward if "somename" can be translated as

www.abcd.com?q=somename but still showing as www.abcd.com/somename And "somename" will be passed to get method for a PHP DB Query like this

$name = $_GET['somename'];

Thank you

Martin
  • 22,212
  • 11
  • 70
  • 132
Pet
  • 61
  • 1
  • 2
  • 9
  • 1
    Use .htaccess and something like [this answer](http://stackoverflow.com/a/1231237/1400579) – DaveP Apr 13 '17 at 15:28
  • 1
    Or [this](http://stackoverflow.com/a/13760676/6140684) or search first! It would be a great idea to try first.. – Antonios Tsimourtos Apr 13 '17 at 15:29
  • 1
    Thanks Antonis and DaveP I will try both suggestion – Pet Apr 13 '17 at 15:31
  • Amazing both of you, i've tried both suggestion and both are working Thank you for investing your time have a nice day :) – Pet Apr 13 '17 at 15:35
  • `FallbackResource /404.php` which could use `$_SERVER['REQUEST_URI']` as an URL slug lookup on your database. – CD001 Apr 13 '17 at 15:56

0 Answers0