Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allow spaces in shortcuts??

Status
Not open for further replies.

JogM

Programmer
Dec 30, 2004
3
NL
I have a problem with my shortcuts in php.
I need them to link to a place/file that has spaces in 'em.
(E.g. one/file.php)
The link is in a php script, and links to a php script.
But somehow my server can't find the file.
But the link is okay (unlike the one in this post..).
Is there a setting in php.ini I can change to fix this?
Or has it something to do with my server (somehow I doubt that, because it used to hadle it okay)
Thanks
 
Try replacing spaces with %20.

--Chessbot

"In that blessed region of Four Dimensions, shall we linger on the threshold of the Fifth, and not enter therein? Ah, no! [...] Then, yielding to our intellectual onset, the gates of the Sixth Dimension shall fly open; after that a Seventh, and then an Eighth -- --" Flatland, A. Square (E. A. Abbott)
 
Yes I've tried that. But it didn't solve the problem.
I also tried to enter the full URL in the adressbar, but still no result.
 
Maybe there's a way to replace blanks in filenames with nothing. Just to remove the spaces?
 
naming convension for files are good.

eg. instead of space, use _ or -

my_god_what_a_nice_girl.jpg is a much better name than my god what a nice girl.jpg

I've heard that for folders, it's best using _, while for images, it's best using -.

eg.

my-dog.jpg should be better than my_dog.jpg

This is some google related issue, but I havent confirmed it, so I dont _really_ know if it's true.

eg. an optimized url for google:

yourdomain.com/pictures/animals/your_name/my-dog.jpg

The folders closes to the domain, will have the most influence on google..

eg. pictures will in this case be more "important" than "your_name".

So, you might also consider:
yourdomain.com/your_name/pictures/animals/my-dog.jpg

Olav Alexander Mjelde
Admin & Webmaster
 
<off topic>
just to clarify

Search Engines treat a hyphen "-" as a space or a word seperator, but a underscore "_" is not. So "my-dog" is equal to "my dog" but "my_dog" is seen as one word.
Not that keyword URLs and page names mean a lot.

Folder depth from the root doesn't matter at all, what counts are the number of "clicks" from the home page that it take to reach the destination page. 3 clicks away is the maximum if you want all your pages indexed reasonably quickly.

for instance page "g/index.htm". if the only path is to it is
root/a/index.htm -> root/a/b/index.htm -> root/a/b/d/index.htm -> root/a/b/d/f/index.htm -> root/a/b/d/f/g/index.htm = 4 clicks would take a considerable time to be indexed.

but root/a/index.htm -> root/a/b/d/f/g/index.htm is only one click away and will get crawled on a regular basis.

</off topic>

Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
ChrisHirst:

root/a/b/c/d/e/f

In this case, the keyword a will be better than the keyword f.. (So I've heard on CEO discussions).

And:
root/pictures/user/car-front.jpg is better than:
root/pictures.php?p=car-front.jpg

for google, and others.

I also wonder if google can not crawl images, that have .php exntesion...

eg. if you have a script that generates images.
<img src="img.php?p=car-front.jpg" /> will not be crawled, to my knowledge.

then it's better using .htaccess and trick the server, so you can run:
<img src="img/car-front.jpg" /> and base it on a script you can find on evolt.org (search friendly urls) and part II.. (the latter is important too).

it has some function to "fake" folders.. the img in this case, is a file without extension. then you can explode the querystring, remove the img/ and then run query, gather image, or whatever you want to do.

Olav Alexander Mjelde
Admin & Webmaster
 
keywords in the URL really only count in one situation. That is when a link uses the URL as the anchor text as well. so for this "root/a/b/c/d/e/f", a b c d e f would all be treated as anchor text, and if the destination page was about "f" then a,b,c,d,e may actually be detracting from the link relevancy.

URL rewriting (as the evolt article) is useful for getting difficult urls crawled (lots of querystring parameters, session ids etc) it does not tell the crawlers that the url is dynamic so the crawler has no indication to slow down or limit the crawl rate, so the server could get overloaded with requests on a very busy site.



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top