Forum Moderators: phranque
The other day, someone helped me add similar rewrite rules to allow images originally uploaded to Typepad to display properly in WP. The images are now displaying fine.
But in looking over my site stats tonight, I see hits from my old format permalinks. This means that the permalink conversion rewrite rules are no longer working & people using old links are getting "post not found" error msgs. when they're brought to my new blog site.
Sure enough, when I looked over my .htaccess file I saw this error:
# File modified on Thu Jun 23 15:26:28 2005 by server
# \xef\xbb\xbf# is not a supported htaccess directive
# # File modified on Thu Jun 23 15:15:28 2005 by server
# \xef\xbb\xbf# is not a supported htaccess directive
Pls. someone tell me if there's an obvious mistake to be corrected.
RewriteEngine On
RewriteBase /tikun_olam/
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [S=50]
RewriteRule ^(about-me)/feed/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?pagename=$1&feed=$2 [QSA,L]
RewriteRule ^(about-me)/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?pagename=$1&feed=$2 [QSA,L]
RewriteRule ^(about-me)/page/?([0-9]{1,})/?$ /tikun_olam/index.php?pagename=$1&paged=$2 [QSA,L]
RewriteRule ^(about-me)(/[0-9]+)?/?$ /tikun_olam/index.php?pagename=$1&page=$2 [QSA,L]
RewriteRule ^(about-me)/trackback/?$ /tikun_olam/index.php?pagename=$1&tb=1 [QSA,L]
RewriteRule ^(contact)/feed/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?pagename=$1&feed=$2 [QSA,L]
RewriteRule ^(contact)/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?pagename=$1&feed=$2 [QSA,L]
RewriteRule ^(contact)/page/?([0-9]{1,})/?$ /tikun_olam/index.php?pagename=$1&paged=$2 [QSA,L]
RewriteRule ^(contact)(/[0-9]+)?/?$ /tikun_olam/index.php?pagename=$1&page=$2 [QSA,L]
RewriteRule ^(contact)/trackback/?$ /tikun_olam/index.php?pagename=$1&tb=1 [QSA,L]
RewriteRule ^(archives-monthly)/feed/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?pagename=$1&feed=$2 [QSA,L]
RewriteRule ^(archives-monthly)/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?pagename=$1&feed=$2 [QSA,L]
RewriteRule ^(archives-monthly)/page/?([0-9]{1,})/?$ /tikun_olam/index.php?pagename=$1&paged=$2 [QSA,L]
RewriteRule ^(archives-monthly)(/[0-9]+)?/?$ /tikun_olam/index.php?pagename=$1&page=$2 [QSA,L]
RewriteRule ^(archives-monthly)/trackback/?$ /tikun_olam/index.php?pagename=$1&tb=1 [QSA,L]
RewriteRule ^feed/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?&feed=$1 [QSA,L]
RewriteRule ^(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?&feed=$1 [QSA,L]
RewriteRule ^page/?([0-9]{1,})/?$ /tikun_olam/index.php?&paged=$1 [QSA,L]
RewriteRule ^comments/feed/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?&feed=$1&withcomments=1 [QSA,L]
RewriteRule ^comments/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?&feed=$1&withcomments=1 [QSA,L]
RewriteRule ^comments/page/?([0-9]{1,})/?$ /tikun_olam/index.php?&paged=$1 [QSA,L]
RewriteRule ^search/(.+)/feed/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?s=$1&feed=$2 [QSA,L]
RewriteRule ^search/(.+)/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?s=$1&feed=$2 [QSA,L]
RewriteRule ^search/(.+)/page/?([0-9]{1,})/?$ /tikun_olam/index.php?s=$1&paged=$2 [QSA,L]
RewriteRule ^search/(.+)/?$ /tikun_olam/index.php?s=$1 [QSA,L]
RewriteRule ^category/(.+)/feed/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?category_name=$1&feed=$2 [QSA,L]
RewriteRule ^category/(.+)/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?category_name=$1&feed=$2 [QSA,L]
RewriteRule ^category/(.+)/page/?([0-9]{1,})/?$ /tikun_olam/index.php?category_name=$1&paged=$2 [QSA,L]
RewriteRule ^category/(.+)/?$ /tikun_olam/index.php?category_name=$1 [QSA,L]
RewriteRule ^author/([^/]+)/feed/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?author_name=$1&feed=$2 [QSA,L]
RewriteRule ^author/([^/]+)/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?author_name=$1&feed=$2 [QSA,L]
RewriteRule ^author/([^/]+)/page/?([0-9]{1,})/?$ /tikun_olam/index.php?author_name=$1&paged=$2 [QSA,L]
RewriteRule ^author/([^/]+)/?$ /tikun_olam/index.php?author_name=$1 [QSA,L]
RewriteRule ^([0-9]{4})/feed/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?year=$1&feed=$2 [QSA,L]
RewriteRule ^([0-9]{4})/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?year=$1&feed=$2 [QSA,L]
RewriteRule ^([0-9]{4})/page/?([0-9]{1,})/?$ /tikun_olam/index.php?year=$1&paged=$2 [QSA,L]
RewriteRule ^([0-9]{4})/?$ /tikun_olam/index.php?year=$1 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/feed/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?year=$1&monthnum=$2&feed=$3 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?year=$1&monthnum=$2&feed=$3 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$ /tikun_olam/index.php?year=$1&monthnum=$2&paged=$3 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/?$ /tikun_olam/index.php?year=$1&monthnum=$2 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?year=$1&monthnum=$2&day=$3&feed=$4 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?year=$1&monthnum=$2&day=$3&feed=$4 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$ /tikun_olam/index.php?year=$1&monthnum=$2&day=$3&paged=$4 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /tikun_olam/index.php?year=$1&monthnum=$2&day=$3 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([^/]+)/feed/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?year=$1&monthnum=$2&name=$3&feed=$4 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([^/]+)/(feed¦rdf¦rss¦rss2¦atom)/?$ /tikun_olam/index.php?year=$1&monthnum=$2&name=$3&feed=$4 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([^/]+)/page/?([0-9]{1,})/?$ /tikun_olam/index.php?year=$1&monthnum=$2&name=$3&paged=$4 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([^/]+)(/[0-9]+)?/?$ /tikun_olam/index.php?year=$1&monthnum=$2&name=$3&page=$4 [QSA,L]
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([^/]+)/trackback/?$ /tikun_olam/index.php?year=$1&monthnum=$2&name=$3&tb=1 [QSA,L]
[edited by: jdMorgan at 9:21 pm (utc) on July 5, 2005]
[edit reason] Removed URL, added code. [/edit]
RewriteCond %{QUERY_STRING} ^/([^.]+)(.htm) [OR] RewriteCond %{QUERY_STRING} ^/([^.]+)(.jpg) RewriteRule ^.shared/image.html$ /%1%2 [R=301,L] For some reason, this rule seems to working (it was intended to allow for display of images imported from my old Typepad blog). But it's caused a conflict with the permalink conversion rules which is preventing them from working.
'#Begin WordPress'
and they end with
'#End Wordpress'
I worked with someone who told me to insert the JUne 23rd jpg rules into the middle of the existing code. Based on what others have told me since perhaps I shouldn't have done that & perhaps that's what the conflict is. If I add the jpg related code either before 'Begin' or after "End" would that work better?
The problem is with the other rewrite rules which are supposed to allow the underscore-formatted links (my old Typepad format) to convert to hyphen-formatted links (my new wordpress format). They're roughly the last 10-12 rewrite rules in the file above. That's where I need help.
If all else fails, wait till your traffic is minimum, and then delete all of the rules, adding them back a few at a time and testing until you find the rule that fails.
Jim