2

I have many files in directory /full/

that's why I would like to spread files to /full1/, /full2/, /full3/ folders on server but to save original URL like

http://my-domain.com/full/article-with-text

to determine which files are where to put I'd like to define it on the URL mask like

^/full/a$ from folder /full1/

^/full/b$ from folder /full2/

tell me please how to build correct .htaccess ?

phpCoder
  • 23
  • 4

1 Answers1

3

Try this

RewriteRule ^full/a(.+)?/?$ http://my-domain.com/full1/a$1 [NC,L]
RewriteRule ^full/b(.+)?/?$ http://my-domain.com/full2/b$1 [NC,L]
RewriteRule ^full/c(.+)?/?$ http://my-domain.com/full3/c$1 [NC,L]
...
RewriteRule ^full/z(.+)?/?$ http://my-domain.com/full26/z$1 [NC,L]

e.g,

http://my-domain.com/full/a-one.txt will mask the url http://my-domain.com/full1/a-one.txt

kolunar
  • 2,623
  • 3
  • 24
  • 35
  • why it's need `R=302` flag? Search engines will think that i'd like to move page, but I'd like only load file from another folder and keep original URL – phpCoder Jan 27 '16 at 11:50
  • sorry, I misunderstood your question, answer has been updated, just remove the [R] flag then you'll have the silent redirect. – kolunar Jan 28 '16 at 01:47