This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Last revision Both sides next revision | ||
choose_php [2017-04-09 15:08] andreas http -> https where appropriate |
choose_php [2019-03-15 18:17] andreas [Features] fixed link/name for Startpage |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== choose.php - ChooSE your search engine ====== | ||
+ | |||
+ | **choose.php** is a PHP script intended to | ||
+ | let users choose their favorite search engine. Instead of providing | ||
+ | a link to a particular web search one can point to an installation of | ||
+ | '' | ||
+ | before doing the actual search. | ||
+ | |||
+ | The script is meant to be used for instance in blog posts and comments | ||
+ | ((Example usage in a comment: "Have you tried to look it up? Most search engines provide good | ||
+ | results, see [[https:// | ||
+ | electronic mail communication (for this purpose the script produces | ||
+ | a link to itself to be copied into the message). | ||
+ | |||
+ | The basic idea is that people should have a free and easy to use choice | ||
+ | of search engines. | ||
+ | |||
+ | ===== ChooSE @wox.at ===== | ||
+ | |||
+ | * [[https:// | ||
+ | |||
+ | ===== Features ===== | ||
+ | |||
+ | * Freedom of choice ;-) | ||
+ | * Extended listing of search engines: Shown with ''? | ||
+ | * Preselect a search engine: A default search engine is set up by the script itself. It can be overruled by adding ''? | ||
+ | * Search engines can be easily added or changed by editing the script. | ||
+ | * Access keys for search engines: E.g. Alt-Shift-g for Google, Alt-Shift-b for Bing, ... | ||
+ | * Access keys for search string field (Alt-Shift-f) and Submit (Alt-Shift-s) | ||
+ | |||
+ | ===== Instructions for use ===== | ||
+ | |||
+ | Feel free to use my own installation of '' | ||
+ | |||
+ | Basically, **choose.php** comes as a single PHP file. Download it (see links below), rename appropriately, | ||
+ | |||
+ | Important settings to make it work are values of '' | ||
+ | <code php> | ||
+ | $me=' | ||
+ | $mesuffix='? | ||
+ | $c_action=" | ||
+ | </ | ||
+ | |||
+ | ==== URL rewriting ==== | ||
+ | |||
+ | For '' | ||
+ | |||
+ | <code htaccess> | ||
+ | RewriteEngine | ||
+ | RewriteBase /s | ||
+ | |||
+ | RewriteRule ^$ index.php | ||
+ | |||
+ | RewriteCond %{REQUEST_FILENAME} | ||
+ | RewriteCond %{REQUEST_FILENAME} | ||
+ | RewriteRule (.*) index.php? | ||
+ | </ | ||
+ | |||
+ | With these rewriting rules I can set in '' | ||
+ | |||
+ | <code php> | ||
+ | $me=' | ||
+ | $mesuffix=''; | ||
+ | $c_action=" | ||
+ | </ | ||
+ | |||
+ | === Dealing with slashes === | ||
+ | |||
+ | If you use the rewriting rules as shown above you'll probably observe that when searching for a string with 2 or more slashes ('' | ||
+ | |||
+ | A solution is to use '' | ||
+ | |||
+ | <code htaccess> | ||
+ | RewriteEngine | ||
+ | RewriteBase /s | ||
+ | |||
+ | RewriteRule ^$ index.php | ||
+ | |||
+ | RewriteCond %{REQUEST_FILENAME} | ||
+ | RewriteCond %{REQUEST_FILENAME} | ||
+ | RewriteCond %{THE_REQUEST} | ||
+ | RewriteRule . | ||
+ | </ | ||
+ | |||
+ | Speaking of slashes, in rare cases they are encoded as '' | ||
+ | |||
+ | # Needed for ChooSE but should not hurt otherwise either | ||
+ | AllowEncodedSlashes On | ||
+ | |||
+ | === Processing ? and & parameters === | ||
+ | |||
+ | Eventually, we also want to pass ''? | ||
+ | |||
+ | <code htaccess> | ||
+ | RewriteCond %{REQUEST_FILENAME} | ||
+ | RewriteCond %{REQUEST_FILENAME} | ||
+ | RewriteCond %{THE_REQUEST} | ||
+ | RewriteRule . | ||
+ | </ | ||
+ | ===== Download & source ===== | ||
+ | |||
+ | * Download current version((Version history is included in main file.)): [[https:// | ||
+ | * Example CSS [[https:// | ||
+ | * Example XML for search engine addon: [[https:// | ||
+ | * View [[https:// | ||
+ | |||