Forum Moderators: phranque
Does anyone have a solution about 301 redirection from a folder to the folder's sub folder?
Example :
From [mydomain.com...] to [mydomain.com...]
I would like all files inside the /blog/ folder being redirected to /blog/subfolder.
Thank you for your help.
I would like redirecting all pages located to /mydirectory to /mydirectory/subdirectory.
My problem was that the redirection was working but was looping no stop. So when I added the line "RewriteCond %{THE_REQUEST}!subdirectory" apache server found the sub directory and stops looping.
Here is the solution I ve just found:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /mydirectory
RewriteCond %{THE_REQUEST}!subdirectory
RewriteRule (.*) [mydomain.com...] [R=301,L]
rewriterule subdirectory/(.*) /mydirectory/$1
The code above is working fine but if you have another suggestion let me know.
Thank you.