Move feeds under new /feeds root

This commit is contained in:
Alex Cabal 2022-06-24 12:54:57 -05:00
parent ee545502af
commit c109c565cb
22 changed files with 136 additions and 99 deletions

View file

@ -102,22 +102,22 @@ Define webroot /standardebooks.org/web
Header set Content-Type "text/plain"
</location>
# application/xml allows the page to be displayed in a browser. application/atom+xml will cause it to be downloaded.
<Location ~ ^/opds.+?$>
<Location ~ ^/feeds/opds>
DirectoryIndex index.xml
Header set Content-Type "application/xml"
</location>
# application/xml allows the page to be displayed in a browser and the encoding to be
# text/xml allows the page to be displayed in a browser and the encoding to be
# determined from the document and not the HTTP headers. application/rss+xml will cause it to be downloaded.
<Location ~ ^/(rss|atom)/.*$>
Header set Content-Type "application/xml"
</Location>
<Directory ~ ${webroot}/www/feeds/>
<Files ~ (\.xml|search\.php)$>
Header set Content-Type "text/xml; charset=utf-8"
</Files>
</Directory>
# Enable HTTP CORS so that browser-based readers like Readium can access opds and ebooks
# Allow fonts for newsletter emails
# See https://github.com/standardebooks/tools/issues/2
<Location ~ /(ebooks|opds|fonts)>
<Location ~ /(ebooks|feeds/opds|fonts)>
Header set Access-Control-Allow-Origin "*"
</Location>
@ -250,7 +250,10 @@ Define webroot /standardebooks.org/web
# If we ask for /opds/all?query=xyz, rewrite that to the search page.
RewriteCond %{QUERY_STRING} ^query=
RewriteRule ^/opds/all.xml$ /opds/search.php [QSA]
RewriteRule ^/feeds/opds/all.xml$ /feeds/opds/search.php [QSA]
# Rewrite old links to feeds
RewriteRule ^/(opds|rss|atom)(.*)$ /feeds/$1$2 [R=301,L]
# Newsletter
RewriteRule ^/newsletter$ /newsletter/subscribers/new.php

View file

@ -101,22 +101,22 @@ Define webroot /standardebooks.org/web
Header set Content-Type "text/plain"
</location>
# application/xml allows the page to be displayed in a browser. application/atom+xml will cause it to be downloaded.
<Location ~ ^/opds.+?$>
<Location ~ ^/feeds/opds>
DirectoryIndex index.xml
Header set Content-Type "application/xml"
</location>
# application/xml allows the page to be displayed in a browser and the encoding to be
# text/xml allows the page to be displayed in a browser and the encoding to be
# determined from the document and not the HTTP headers. application/rss+xml will cause it to be downloaded.
<Location ~ ^/(rss|atom)/.*$>
Header set Content-Type "application/xml"
</Location>
<Directory ~ ${webroot}/www/feeds/>
<Files ~ (\.xml|search\.php)$>
Header set Content-Type "text/xml; charset=utf-8"
</Files>
</Directory>
# Enable HTTP CORS so that browser-based readers like Readium can access opds and ebooks
# Allow fonts for newsletter emails
# See https://github.com/standardebooks/tools/issues/2
<Location ~ /(ebooks|opds|fonts)>
<Location ~ /(ebooks|feeds/opds|fonts)>
Header set Access-Control-Allow-Origin "*"
</Location>
@ -249,7 +249,10 @@ Define webroot /standardebooks.org/web
# If we ask for /opds/all?query=xyz, rewrite that to the search page.
RewriteCond %{QUERY_STRING} ^query=
RewriteRule ^/opds/all.xml$ /opds/search.php [QSA]
RewriteRule ^/feeds/opds/all.xml$ /feeds/opds/search.php [QSA]
# Rewrite old links to feeds
RewriteRule ^/(opds|rss|atom)(.*)$ /feeds/$1$2 [R=301,L]
# Newsletter
RewriteRule ^/newsletter$ /newsletter/subscribers/new.php