Forum Moderators: phranque
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} !.*s=.*
RewriteCond %{HTTP_USER_AGENT} !something
RewriteCond %{QUERY_STRING} !.*attachment_id=.*
RewriteCond %{HTTP_COOKIE} !^.*(comment_author_¦wordpress¦wp-postpass_).*$
RewriteCond %{DOCUMENT_ROOT}/cache/somefolder/$1.html -f
RewriteRule ^(.*) /cache/somefolder/$1.html [L]
Basically what it does is rewrite
www.example.com/abab/foo
to
/cache/somefolder/abab/foo.html only if the file exists... otherwise follow other directives.
What i would like it to do additionally is rewrite :
www.example.com/abab/foo/feed
to
/cache/somefolder/abab/foo.xml
any clues here? I am absolutely hopeless in regexp and rewrite rules.
Any help will be highly appreciated.
In all of your RewriteCond lines, if there is a .* that is immediately adjacent to a start or end anchor, you can safely delete the .* and delete the start or end anchor.
In all of your RewriteCond lines, if there is a .* at the very beginning or at the very end of the condition, then the .* part can be deleted.
In the RewriteRule, the .* matches "everything" so it will need to be altered to match a specific pattern.
You'll then need another Rule to match some other different specific pattern.
The problem you face isn't all that much different to this post from just yesterday: [webmasterworld.com...]