homepage Welcome to WebmasterWorld Guest from 54.204.141.129
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Can Dreamweaver MX handle PHP files with no extension?
Can Dreamweaver MX handle PHP files with no extension?
trtech




msg:1308616
 1:06 am on Jan 29, 2004 (gmt 0)

In an earlier post (here: [webmasterworld.com...] ) which is now locked, geckofuel asked about Dreamweaver's problem dealing with files which have no extenstions (i.e. no dot in the file name). jatar_k responded suggesting that geckofuel simply enable php parsing for the html extension.

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:
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"

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:
<Files script>
ForceType application/x-httpd-php
</Files>

Now I can use the URL:
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.

Please encourage Dreamweaver to add the ability to work with files that have no extension, please submit a bug report:
[macromedia.com...]

[1][edited by: jatar_k at 9:32 pm (utc) on Jan. 29, 2004]
[edit reason] fixed link [/edit]

 

WibbleWobble




msg:1308617
 10:20 am on Jan 29, 2004 (gmt 0)

Search engines won't index the page because of the "?" in the URL. So, I switch to using Apache's [...]

This is an arcane idea; all the major search engines are thoroughly adept at handling query strings, usually to two or three variables.

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.

httpwebwitch




msg:1308618
 11:02 am on Jan 29, 2004 (gmt 0)

I recently moved a bunch of pages around using .htaccess, I was using the exact same strategy - turning my page.htm?var=foo into page/foo.htm

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...

lasko




msg:1308619
 12:26 pm on Jan 29, 2004 (gmt 0)

trtech

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

WibbleWobble




msg:1308620
 3:06 pm on Jan 29, 2004 (gmt 0)

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.

trtech




msg:1308621
 9:02 pm on Jan 29, 2004 (gmt 0)

Well, I want to make sure that all search bots can spider my site, so I'm going to move to the "archaiac" method of passing variables via the url.

Regardless, Dreamweaver needs to be able to deal with filenames that have no extenstion.

rogerd




msg:1308622
 9:17 pm on Jan 29, 2004 (gmt 0)

WibbleWobble, I can't speak for your situation, but that "PR0" on dynamic pages may not be real. I have a number of dynamic pages that have shown no PR for months but perform well in slightly competitive searches.

jatar_k




msg:1308623
 9:46 pm on Jan 29, 2004 (gmt 0)

Well there seem to be a ton of strangely related topics in this thread so let's see if we can throw a little light on the whole thing.

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]

Giacomo




msg:1308624
 8:18 pm on Feb 13, 2004 (gmt 0)

FYI, EditPlus lets you configure a default syntax highlighting to be applied to files with no extension. I too use the ForceType trick to build querystring-less URLs with Apache+PHP, and EditPlus works just great for me. I only use DW to lay out visually what is not so easily done "by hand" (such as table design and so on). ;)

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>

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved