Created
January 9, 2013 15:07
-
-
Save masiorama/4493819 to your computer and use it in GitHub Desktop.
Apache: set canonical urls for files insice .htaccess
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#get all the pdfs and set a canonical url using the name of the file as pagename | |
RewriteRule ([^/]+)\.pdf$ - [E=FILENAME:$1] | |
<FilesMatch "\.pdf$"> | |
Header add Link '<http://example.com/httest/%{FILENAME}e.html>; rel="canonical"' | |
</FilesMatch> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment