webonomic
2012-04-18 03:39:55 UTC
This may not be the correct group to ask for help on htaccess, but
I've searched high and low for answers and I don't know where else to
turn.
I almost have a working solution. Current code is this:
Options +FollowSymLinks
RewriteEngine on
RedirectMatch permanent (.*).html$ http://newdomain.com/blog/$1/
[R=301,L]
The problem with the above code is that it retains the directory
structure. I moved my blog from olddomain.com for which a typical URL
is:
http://olddomain.com/2012/01/17/some-file-here.html
The new domain is as such:
http://newdomain.com/blog/some-file-here/
So the new domain does not have the same folder structure but has the
same filename minus the file extension. I have hundreds of HTML files
that are now in this new URL format, so one rule is preferable. Can
someone explain how I can correct the htaccess code?
TIA,
Jared
I've searched high and low for answers and I don't know where else to
turn.
I almost have a working solution. Current code is this:
Options +FollowSymLinks
RewriteEngine on
RedirectMatch permanent (.*).html$ http://newdomain.com/blog/$1/
[R=301,L]
The problem with the above code is that it retains the directory
structure. I moved my blog from olddomain.com for which a typical URL
is:
http://olddomain.com/2012/01/17/some-file-here.html
The new domain is as such:
http://newdomain.com/blog/some-file-here/
So the new domain does not have the same folder structure but has the
same filename minus the file extension. I have hundreds of HTML files
that are now in this new URL format, so one rule is preferable. Can
someone explain how I can correct the htaccess code?
TIA,
Jared