http://example.com/abc/media TO http://example.com/media
How to set this URL with use of .htaccess?
2
RewriteCond %{REQUEST_URI} ^/abc/$ RewriteRule .* - [E=MAGE_RUN_CODE:aaa] RewriteCond %{ENV:REDIRECT_MAGE_RUN_CODE} (.+) RewriteRule .* - [E=MAGE_RUN_CODE:%1] RewriteBase /abc/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /abc/index.php [L]/
This is my .htaccess file.
Now we need to remove /abc/ folder from image URL so we get all image URL from the Root directory.
/abc/
<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^.*/abc/media/(.*)$ http://%{HTTP_HOST}/media/$1 [L,R=301] </IfModule>
Already Try this but not working on my site.
Could you try:
<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$ abc/$1 [L] </IfModule>
If u using only for image. You can try with:
Click here to cancel reply.
2
Answers
This is my .htaccess file.
Now we need to remove
/abc/
folder from image URL so we get all image URL from the Root directory.Already Try this but not working on my site.
Could you try:
If u using only for image. You can try with: