I have used XAMPP in my local machine. My PHP Version 5.2.4. I want to get value from URL.
index.php(C:\xampp\htdocs\PHPJ)
preg_match("/[^\/]+$/",$_SERVER['REQUEST_URI'],$match);
echo $match[0];
when i navigate localhost:70/phpj/ then No output will be displayed.
but i try to navigate localhost:70/phpj/abcdef then generate an Object not found! Error 404
when i type like localhost:70/phpj/?abcdef then output ?abcdef
I also write .htaccess file in PHPJ directory
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
I checked my Apache error log
[Sat Sep 24 16:13:01 2016] [alert] [client 127.0.0.1] C:/xampp/htdocs/PHPJ/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
My goal is to when i type localhost:70/phpj/abcdef then index file give me output like abcdef