Forum Moderators: coopster
Another question for my site, this one im sure is quite an easy one though. What I need is some way of having a script which lets me do the following:
Instead of having a URL [blar.com...] I would like to have a script which lets me have a URL like [blar.com...]
i.e. have a keyword which relates to a URL.
Im guessing this is the same sort of thing as having a download script which would do something similar.
Again, peeps, any ideas are welcome.
Rich
As bartek says in any case it would thwart your SEO to a degree since SE's arent very keen on dynamic urls, so you would need something in place to rewrite the urls to static ones (e.g mod_rewrite).
Yes, Perlyking, the parameter after the ? is where I would want the user to be directed to, so for example index.htm?GoingOut would go to, for example GoingOut.htm or something alike.
Mod_rewrite, I've read a lot of stuff on WMW about that but I still am unsure as to what it is, or how to use it....any help??
Mod_rewrite - theres a bit of a discussion here: [webmasterworld.com...] with an example that might help explain it, have a look using the search function for mod_rewrite and you will turn up a few more articles.
Hope this helps.
David - you're right, I read about that "get" variable last night. I know I can put it into a hyperlink, such as:
"<a href=link.php?Page=Blar>" which means when link.php loads it gives the variable 'Page', the value 'blar'. I get that, but what I need to know now is how to relate this, to displaying the "blar" data and not the rest..... ideas.... please... keep going guys, you're doing me proud so far!!
inside of link.phtml you then test with an if statement;
if ($blar == 1){
header("location:/yourfile.phtml");
}
You should read about:
header files - (do's and dont's)
conditional statements - (you might like the "switch" statement for what you are doing)
hope this helps
header("location:/yourfile.phtml");
say if my file was in goingout/file.htm - would this link then become
header("location:/goingout/file.htm");
???
Also, I've just thought about this whole thing. Couldn't I just create a page with all my links in, like David has just described, for example:
if ($blar == 1){
header("location:/yourfile.phtml");
}
if ($blar == 2){
header("location:/yourfile2.phtml");
}
if ($blar == 3){
header("location:/yourfile3.phtml");
}
and then link to each page with the appropriate number.
Would that work??
Cheers guys, this is top work!