1

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


  • 2
    Possible duplicate of [.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration](http://stackoverflow.com/questions/10144634/htaccess-invalid-command-rewriteengine-perhaps-misspelled-or-defined-by-a-m) – Alex Andrei Sep 24 '16 at 11:43
  • You don't have the mod_rewrite module installed. Possible duplicate of stackoverflow.com/questions/10144634/htaccess-invalid-command-rewriteengine-perhaps-misspelled-or-defined-by-a-m – Kristoffer Bohmann Sep 24 '16 at 11:45

0 Answers0