apache - Reading file from different directory with htaccess -


i want this:

if request comes domain.com/photos/1.jpg should read file new_photos/1.jpg directory. url should still same. tried line this:

rewriterule ^photos/(.*)$ new_photos/?$1 

it doesn't work. how can fix it?

edit:

my full htaccess file:

rewriteengine on rewritecond %{http_host} ^www\.(.+)$ [nc] rewriterule ^(.*)$ http://%1/$1 [r=301,l]  rewritecond %{request_uri} ^/system.* rewriterule ^(.*)$ index.php/?$1 [qsa,l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.+)$ index.php/?$1 [qsa,l] rewritecond %{http_host} ^app.domain.com$ rewriterule ^robots\.txt$ robots-subdomain.txt 

if file in /new_photos dir ,you can use :

rewriterule ^photos/(.*)$ new_photos/$1 [nc,l] 

Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -