如何设置linux服务器,以便URL通过单个php模板文件传递?

I am making a template for a website and want every page to be passed through a single php file to allow for both easy page editing and elegant, intuitive URLs. I have a standard Linux webhosting package and want so that when the user visits http://example.com/language-x/a-page-called-foo then the sever invokes and returns the output from http://example.com/template.php?page=a-page-called-foo&language=language-x without the user seeing anything to do with tamplate.php in the address bar. Is there some standard way to do this so I don't have to contact my webhosting provider and asking for them to tweak the way the server is working?

Assuming you are using Apache with mod_rewrite enabled as your webserver, what you can do is create a .htaccess file in your application root. The content of this file should, roughly, contain something like this:

RewriteEngine On
RewriteRule ^([a-zA-Z0-9]+)/$ index.php?page=$1

You can read more about this subject here http://www.desiquintans.com/cleanurls

Try to learn basic Regular Expressions patterns, as this is used for matching your URLs. http://regexone.com/