Forum Moderators: open
My reason for asking is that I want to make a site map that the search engine spiders can follow. I want to 'hard code' the search parameter into links so that page (hopefully) comes up in the search engine resultes pages (SERPS).
For example, I wish to have a query of widgets in a city come up which would normally be done through an internal search form but on the site map I would have a hard link:
<a href="http://someportal.com?type=widgets&city=somecity">Find City Widgets</a>
Basically, I am hoping that a 'filled in' link will be spiderable. Any comments or other suggestions in making a dynamic site spiderable?
[edited by: agerhart at 5:45 pm (utc) on Sep. 24, 2003]
[edit reason] removed specifics [/edit]
I've had no troubles with links of the kind you indicated.
SN
I have created an .htaccess file with:
<FilesMatch "^id$">
ForceType application/x-httpd-php
</FilesMatch>
And then another file "id" with:
<?php
$idpath = explode("/",$_SERVER['PATH_INFO']);
$newid = intval($idpath[1]);
include("http://www.mysite.com/?id=$newid");
?>
What this does it turn:
[mysite.com...]
into:
[mysite.com...]
Two dilemmas:
I don't want to have to use an absolute path in the id file because this feature is going to be made available to other users of the CMS I'm using.
When you use the static path, relative links in the html that is included are broken. This is because they think they are in another subdirectory when in fact it's just smoke and mirrors.
So instead of rewriting all my html with absolute paths or doing some other hack, I would like to accomplish this:
[mysite.com...]
That way the relative links work okay. I was looking at Apache core directives and came up with something like:
<Location ~ "/id*">
//some type of parsing here
</Location>
But I'm rather new to both php and .htaccess so for now this is getting the best of me. I know what I want to do logically but don't know what to do syntactically.