Amol Kanherkar
Amol Kanherkar

Reputation: 1

How can I rewrite my image path?

In inspect element image path is showing like ../wordpress/wp-content/uploads/2014/07/Hydrangeas.jpg

while I want it to show like ../images/Hydrangeas.jpg by url rewrite.
Is it possible with .htaccess file?

Upvotes: 0

Views: 235

Answers (2)

Domain
Domain

Reputation: 11808

Use this code in your .htacces file which will achieve what you want.

Redirect 301 /wordpress/wp-content/uploads/2014/07/Hydrangeas.jpg www.example.com/images/Hydrangeas.jpg

Upvotes: 1

sirBlond
sirBlond

Reputation: 335

you'll need to place this snippet in your wp-config.php file:

define( 'UPLOADS', ''.'images' );

there's no need in touching .htaccess

Upvotes: 0

Related Questions