Cruft-free URLs

http://www.debian-administration.org/articles/136
Making prettier URLs with mod_rewrite

But, if I'm reading the Admin page for Gallery options, `Enable mod_rewrite, Zenphoto` will actually add the extension but doesn't explain why.
`If mod_rewrite is checked above, zenphoto will appended this to the end (helps search engines). Examples: .html, .php, /view, etc.`

Sounds like it'll doing different from the other explanation. Maybe clarify? (I did the Google search because I didn't understand the Zenphoto explanation for this option, which I was going to try.)

Comments

  • trisweb Administrator
    The .php means nothing to the server, it does not tell it to parse the files as PHP or anything.

    The URL's zenphoto uses for images *must* contain the full image filename, for example "imagename.jpg", so the full URL would be something like http://www.zenphoto.org/zenphoto/demo-gallery/P4100284.jpg.php .

    Because of this requirement, search engines can be *very* confused by the URLs. They should NOT end in .jpg, or search engines (and users too) will think the URL contains image data when it is actually a web page.

    This means *something* must be added to the URL that makes sense for a web page. `.php` is the most logical choice since the pages are generated by PHP, and that tells search engines that this is dynamic server-generated content, which guides them on how to crawl the site more efficiently. You can use anything as the suffix that you want, but it should be normally associated with page content and not image content.

    If, as Ryan Brill suggests, you want something else to end your URLs, you can set this suffix to something like `/view` and it will show as http://www.zenphoto.org/zenphoto/demo-gallery/P4100284.jpg/view which is perfectly acceptable.

    However, as I've described, Zenphoto requires the full image filename in the URL, as that's how it locates the image.

    We actually did explain why we do this right in the explanation you pasted right after you said it "doesn't explain why." - Notice the explanation, "(helps search engines)."

    Hope that clears things up.
Sign In or Register to comment.