I moved a site that used to be at example.com/en/
to just example.com
.
however the graphics as still linked to /en/
.
What do I need to add to my .htaccess
to make the site serve files under /en/
as well.
I moved a site that used to be at example.com/en/
to just example.com
.
however the graphics as still linked to /en/
.
What do I need to add to my .htaccess
to make the site serve files under /en/
as well.
This can depend on what directives you already have in your
.htaccess
. However, to internally rewrite any request for "images" ie./en/<something>/<whatever-image>
. Then you could do something like the following at the top of your.htaccess
file:This allows you to effectively serve image files under both locations, whilst the actual files are outside of
/en/
.If you want to rewrite everything then do something like:
However, if you've "moved" the site then you probably want to externally "redirect" the page URLs in order to preserve SEO? However, if you are still linking to some images using the
/en/
subdirectory then you need to be sure to redirect pages only.