You are here: Re: redirect / new website how to redirect old (google) links to new site ? « PHP Programming Language « IT news, forums, messages
Re: redirect / new website how to redirect old (google) links to new site ?

Posted by Andy Hassall on 11/11/06 03:29

On Fri, 10 Nov 2006 22:12:47 -0500, Jerry Stuckle <jstucklex@attglobal.net>
wrote:

>> You've missed the point - I don't believe anyone has suggested that you do
>> that.
>
>Andy, that's exactly what Micha is suggesting. Remove the extension
>from the file and have Apache parse all files the same way.
>
>In fact, his first suggestion was to tell Apache to parse all .html
>files with PHP, whether they included PHP code or not.

That was as a solution for the OP that already had URLs with .html suffixes.

> Then I brought
>up other conditions - like the site I mentioned which currently uses
>asp, php and perl - and will soon probably be using python.
>
>And I'm supposed to parse every page for each of these?

The discussion then went onto extension-less URIs, and implicitly into the
Apache MultiViews option. This option does not run all files through every
possible processing option.

The files on the filesystem still have extensions to indicate what processing
the webserver should do with them (such as .php for PHP processing, or .gif for
none, etc.).

But the URI space doesn't have to map directly onto the filesystem space. You
can omit the extension when Apache is configured appropriately. For example:

* You access: http://example.com/something
* The document root directory may be /var/www/
* There may be a file named /var/www/something.php
* There would typically be no other files with the base filename
'/var/www/something'.
* Apache's MultiViews selects something.php as the suitable file to serve for
the URI, and parses it with PHP due to a previous AddType declaration for the
..php filesystem extension.
* End of story - it's not parsed for SSI or Python or Perl or whatever.

This is the simplest case of content negotiation.

If there were /var/www/something.pl, /var/www/something.py,
/var/www/something.html, /var/www/something.shtml, /var/www/something.png,
/var/www/something.jpeg and /var/www/something.cgi all together - and even
/var/www/something.en.html and /var/www/something.fr.html etc. then things get
more complicated, but it still would only run one of the processing options
anyway depending on which was selected as most suitable to serve the URI
http://example.com/something.

You should read: http://httpd.apache.org/docs/2.2/content-negotiation.html

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация