Question

I need to rewrite a directory and all is contents to a new directory however I am having issues I think due to the source directory having a full stop in it.

i.e.

http://example.com/1.0/ to http://example.com/newfolder/

Here is the rule I am trying

RewriteEngine On
RewriteBase /

RewriteRule ^1\.0$ http://example.com/newfolder/ [NC,R=301,L]
Was it helpful?

Solution

You can use:

RewriteEngine On

RewriteRule ^1\.0(/.*)?$ http://example.com/newfolder$1 [R=301,L]

This will redirect /1.0/anything to /newfolder/anything

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top