My htaccess:
RewriteEngine On
RewriteCond $1 !^(index\.php)
RewriteRule ^(.*)$ index.php?l=$1 [L]
and php:
<?php
$links = parse_ini_file('links.ini');
if(isset($_GET['l']) && array_key_exists($_GET['l'], $links)){
header('Location: ' . $links[$_GET['l']]);
}
else
include ('index.html');
?>
In the links.ini I have short url and website url:
youtube1 = "https://www.youtube.com/watch?v=9bZkp7q19f0"
youtube2 = "https://www.youtube.com/watch?v=wcLNteez3c4"
etc.
These files are in the root and url shortening works.
In the index.html I have menu with static html pages:
<a href="/" >Home page</a>
<a href="page1" >page1</a>
<a href="page2" >page2</a>
etc.
But when I click on them it only reloads index.html?
Any help will be appriciated!
I tried to put static html links into links.ini:
page1 = page1
but that doesn't work either... I get the Page isn't redirecting properly error.
var_dump($links);?