WordPress.org

Ready to get started?Download WordPress

Forums

Need Rewrite Rule for Images after moving WP (3 posts)

  1. bolonki
    Member
    Posted 8 years ago #

    Hi guys,

    I need a rewrite rule so that images point to the right place.

    Old address:
    http://www.main.com/smith/images/photo22.jpg

    New address:
    http://www.smith.com/images/photo22.jpg

    I don't know the syntaxis of rewrite rules, can someone post the rewrite rule for this?

    Thanks

  2. niziol
    Member
    Posted 8 years ago #

    I think this rule may work for you:

    RewriteEngine on
    RewriteBase /
    RewriteRule ^smith/images/(.*)$ /images/$1

    It should redirect ANY request for /smith/images/ to /images/, so say: /smith/images/hi.gif -> /images/hi.gif. This assumes that the .htaccess will be in your root directory.

    Good luck,
    Michael

  3. bolonki
    Member
    Posted 8 years ago #

    Thanks Michael! I will try it out, thanks for your answer, I appreciate it.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.