WordPress.org

Ready to get started?Download WordPress

Forums

Stop WP adding extra slash after filename? (1 post)

  1. SocialBlogsite
    Member
    Posted 2 years ago #

    I've quit trying to find a pair of pattern->substitution to regex-redirect missing files to the folder they are in, because all of them end up in an infinite loop, so now I'm adding my rewrite rules as a whole, hooking them to mod_rewrite_rules, so I can add a rewriteCond above each.

    The problem is that the files redirected get a trailing forward slash added, like
    /_here/findme.swf/

    If I put my rules AFTER wordpress they won't work.
    If I remove wordpres redirects, they work fine, but I need my WP rewrites for SEO!

    Here's the code I'm using.

    function find_findme_anywhere( $rules ) {
    return "/n#Finds findme.swf
    RewriteEngine On
    RewriteBase /
    Options +FollowSymlinks
    RewriteCond %{REQUEST_URI} !_here/
    RewriteRule ^.*findme.swf$ /_here/findme.app/Contents/Resources/findme.swf [R=301,L]" . $rules;
    }
    add_filter('mod_rewrite_rules', 'find_findme_anywhere');

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by SocialBlogsite
  • This topic is not resolved
  • WordPress version: 3.2.1