The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
Okay not that I use it (yet) but is it possible to do something like tinyurl on twitter? So instead of using tinyurl.com I create
http://markswebsite.com/gh7
to direct users to a page on my site. That way I don't have to give out long urls in emails, twitter, facebook etc and I don't have to advertise tinyurl.So is this a good idea and something I could do? Tinurls expire too right?
Thanks guys, merry christmas!
You may also want to try a single PHP file called "re.php" or something, and place within this file the code:
<?php
if (isset($_GET['web'])) {
$addr = trim($_GET['web']);
$shortcodes = array();
$shortcodes["[B]ah7[/B]"] = "[B]chaper/4.htm[/B]";
$shortcodes["[B]bj5[/B]"] = "[B]page/7.htm[/B]";
$shortcodes["[B]cjh[/B]"] = "[B]the/man.htm[/B]";
foreach ($shortcodes as $name=>$value) {
if ($name == $addr) {
header($_SERVER['SERVER_PROTOCOL']." 301 Moved Permanently");
header("Location: http://markswebsite/".$value);
exit;
}
}
header($_SERVER['SERVER_PROTOCOL']." 404 Not Found");
} else {
header($_SERVER['SERVER_PROTOCOL']." 404 Not Found");
}
?>
... and within your .htaccess file, include the lines:
RewriteEngine on
RewriteRule ^web/([^/.]+)$ http:///markswebsite.com /re.php?web=$1
RewriteRule ^web/([^/.]+)/$ http://markswebsite.com /re.php?web=$1
This will then redirect any web address that starts with http://markswebsite.com/web/ to the re.php file, with anything after the URL being placed as a query string, which means anything like
http://markswebsite.com/web/ [B]ah7[/B]
will end up as http://markswebsite.com/re.php?web= [B]ah7[/B]
, where [B]ah7[/B]
is you desired short URL.Within the PHP file, you should see an array has been created that contains the short URL as the array name, and the real web address as it's value. Just add / remove as desired in this area to make your short URL redirects.
The reason I've added the
[B]/web/[/B]
part is because I'm not advanced enough in .htaccess URL manipulation to get it done from the root directory, sorry again. .htaccess, php, javascript and php/mysql can all be used.
Machie wrote in the past about having 3 or 4 hundred sub domains on the go so he might need to go for a MySql solution to make things manageable!
Google your own tinyurl code for more ideas...
I didn't like to reply before as I thought Machie only wanted to hear from Garin...
Search Freeola Chat
> Glad to see you got your website running in the end.
>
> You look different in the pictures than I imagined :¬P
>
>
>
>
>
>
>
> Search Freeola
> Chat
Like the quad bikes:-)
So where did Garin go....?
RewriteEngine on
RewriteRule [B]gh7/[/B] [I]http://markswebsite.com/page/one.html[/I] [B][R=301][/B]
RewriteRule [B]ad6/[/B] [I]http://markswebsite.com/section/two.html[/I] [B][R=301][/B]
... which should take care of what you're after, though it has been a while since I've played with URL re-writing, so that syntax may be slightly inaccurate, sorry.
Alternatively, you could create an
index.php
with the code:<?php
header($_SERVER['SERVER_PROTOCOL']." 301 Moved Permanently");
header("Location: http://markswebsite.com/[B]section/two.html[/B]");
?>
... and creating a folder with the short name you want to use, so that a folder called "ad6" contained the index file above, and whenever someone goes to http://markswebsite.com/ad6, the index.php file is loaded, and redirects to the larger URL.
For each folder you create, you'll need to alter the URL in the index.php file to correctly reflect your desired redirect. It may also become a pain to maintain if you have a large number of redirects.
You look different in the pictures than I imagined :¬P
Search Freeola Chat
Okay not that I use it (yet) but is it possible to do something like tinyurl on twitter? So instead of using tinyurl.com I create
http://markswebsite.com/gh7
to direct users to a page on my site. That way I don't have to give out long urls in emails, twitter, facebook etc and I don't have to advertise tinyurl.So is this a good idea and something I could do? Tinurls expire too right?
Thanks guys, merry christmas!