########################################## # This .htaccess file controls the URL rewriting # and other server configurations for www.GoogolplexWrittenOut.com # This file should be uploaded to # http://www.GoogolplexWrittenOut.com/.htaccess # The idea of URL rewriting is that for example if you want to # download the PDF file with volume 12345 of the book, you do # not need to visit an ugly URL like # http://www.GoogolplexWrittenOut.com/cgi-bin/makepdf.pl?12345 # but you can simply visit the URL # http://www.GoogolplexWrittenOut.com/volume12345.pdf # which looks much nicer. # switch the rewrite engine on: RewriteEngine On # make sure that address starts with www.GoogolplexWrittenOut.com RewriteCond %{HTTP_HOST} !^www.GoogolplexWrittenOut.com$ [NC] RewriteRule ^(.*)$ http://www.GoogolplexWrittenOut.com/$1 [R,L] # make sure that https is not used RewriteCond %{HTTPS} on RewriteRule ^(.*)$ http://www.GoogolplexWrittenOut.com%{REQUEST_URI} [R,L] # get rid of query-strings outside of cgi-bin RewriteCond %{REQUEST_URI} !^.*/cgi-bin/.*$ RewriteCond %{QUERY_STRING} ^.+$ RewriteRule ^(.*)$ /$1? [R,L] # make the internal rewriting so that for example visitors who go to # http://www.GoogolplexWrittenOut.com/volume12345.pdf # see the page which is internally available at # http://www.GoogolplexWrittenOut.com/cgi-bin/makepdf.pl?12345 RewriteRule ^volume([1-9][0-9]*)\.pdf$ /cgi-bin/makepdf.pl?$1 # make the internal rewriting for summary HTML pages RewriteRule ^volume([1-9][0-9]*)\.htm$ /cgi-bin/makehtml.pl?summary=$1 # make the internal rewriting for list of volumes pages # In the following, I use %1 as a variable vith value 000 RewriteCond 000 (^000$) RewriteRule ^list([1-9][0-9]*)\.htm$ /cgi-bin/makehtml.pl?list=$1%1 # php -- BEGIN cPanel-generated handler, do not edit # Set the “ea-php72” package as the default “PHP” programming language. AddHandler application/x-httpd-ea-php72___lsphp .php .php7 .phtml # php -- END cPanel-generated handler, do not edit