Support » Fixing WordPress » Redirecting question

Viewing 1 replies (of 1 total)
  • I’ve not had this problem (and have never needed to hand-craft my rewrite rules), but some googling lead me to this site, which says:

    An easier RedirectMatch command…
    RedirectMatch permanent ^/([-¸·{|}´‘”+*^¯¨¬\\]|”||\^\^)(.*)$ http://www.domain.com/~$2

    ... and more complex, but much better set of RewriteRules (needs mod_rewrite):
    # Part a: URL does not end with "/"
    RewriteCond /var/htdocs/$1$2 !-d
    RewriteCond /var/htdocs/$1$2 !-f
    RewriteCond /~$2 -U
    RewriteRule ^/([-¸·{|}´'"+*^¯¨¬\]|''||^^)(/?([^/]+)(/.*[^/])?)?$ http://www.domain.com/~$2 [R=permanent,L]

    # Part b: URL ends with “/”
    RewriteCond /var/htdocs/$1$2 !-d
    RewriteCond /~$2 -U
    RewriteRule ^/([-¸·{|}´
    ‘”+*^¯¨¬\\]|”||\^\^)(/?([^/]+)(/.+)?/)?$ http://www.domain.com/~$2 [R=permanent,L]`

    Hopefully that helps you out.

Viewing 1 replies (of 1 total)
  • The topic ‘Redirecting question’ is closed to new replies.