How do I redirect folder paths for Apache, for example for all images
in .htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/folderonsite/(.*?)$ /backup/folderwithfiles/$1 [L]
or
RewriteRule ^folderonsite/(.*?) /home/folderwithfiles/$1 [L]
it doesn't work, it says url not found — I don't need the redirect on the hosting, I need it done on the server in a different folder not from the hosting account
then check whether the alias module is enabled
and try adding this to the apache config
Alias /pathonsite/ /home/realpathtofile/
or
AliasMatch ^/pathonsite/(.*)$ /home/realpathtofile/$1
apache gives an error: Apache error "AliasMatch not allowed here"
AliasMatch and Alias are not available in .htaccess
you must place them only in the Apache config.
Comments