Forum Moderators: coopster
I am having the same problem. I'm not trying to hide the extension from anyone except seach engine bots that don't like to index pages with variables passed via the query string and don't like to index pages that have an illegal dot in the name.
For example, I have the page: www.example.com/script.php?article=123
Search engines won't index the page because of the "?" in the URL. So, I switch to using Apache's "look back" feature: But there is still a problem: Many search bots see that this is technically an invalid URL because of the dot in the middle of it. So, I direct Apache to "ForceType" in .htaccess: Now I can use the URL: Please encourage Dreamweaver to add the ability to work with files that have no extension, please submit a bug report: [1][edited by: jatar_k at 9:32 pm (utc) on Jan. 29, 2004]
www.example.com/script.php/123/
I can now parse the article value (123) from the string using PHP's explode function:
$vars = explode("/", $PATH_INFO);
$article = $vars; // FYI: $vars[0] = "script.php"
<Files script>
ForceType application/x-httpd-php
</Files>
www.example.com/script/123 and everybody's happy except Dreamweaver, which will not open, save, upload or download the file because it has no extenstion.
[macromedia.com...]
[edit reason] fixed link [/edit]
Search engines won't index the page because of the "?" in the URL. So, I switch to using Apache's [...]
Also, for semantics sake, it would surely be a good idea to maintain extensions for your various code files, so you can see at a glance which language they purport to be in. You could easily hide the exntension through php code and an Apache RewriteRule.
Those pages were all Googlebotted, then promptly (within a week) slammed with a PR0. I can't be sure if it was the Apache noodling that caused the Googewrath, but it seems like the most plausible explanation.
so, be careful...
I have had pages indexed easily by Google and others with up to 3 strings.
?myid=1&this=2&yes=3
You wont have any problem with 1 string
?myid=1
Google is actually no spidering some session pages which is worse the php values.
Just one tip name your variables carefully, keep them to about 4 characters and don't just use ID= name it differently like myid=
Hope it helps
Those pages were all Googlebotted, then promptly (within a week) slammed with a PR0. I can't be sure if it was the Apache noodling that caused the Googewrath, but it seems like the most plausible explanation.
This is [at least in my mind] certainly not the reason, as I only recently (last three months) configured an ecommerce site to move from file.ext?one=two&three=four to the spinky /two/four/file.ext -- these now vary between PR4 and 5, depending on the page. I can't attribute this to lincoming links, as there are few, but its clear that set up correctly, apache's rewrites won't be hindered by Google [or indeed, any other] algorithms, simply because its all server side, and google won't know about them.
Dreamweaver's problem dealing with files which have no extenstions
Well, windows can't deal with files without extensions either.
have you thought using mod_rewrite to change
www.example.com/script.php?article=123
into
www.example.com/script/123.html
all the major search engines are thoroughly adept at handling query strings, usually to two or three variables.
I would say 2 max and if you have a way of rewriting them or getting rid of them all together then you are better off.
I can't be sure if it was the Apache noodling that caused the Googewrath
It definitely wasn't, I'm with rogerd.
don't just use ID=
good advice lasko, as mentioned by Googleguy and also by many other people, session id's can cause some issues with spidering.
If you do decide on mod_rewrite take a look at
An Introduction to Redirecting URLs on an Apache Server
For mod_rewrite beginners [webmasterworld.com]
About forcing the content type, a word of warning: images must not be served as text/html (unless you were looking for problems), so you'd better use something like this:
ForceType application/x-httpd-php
<FilesMatch "\.(gif¦jpe?g¦png¦zip¦pdf)$">
ForceType none
</FilesMatch>