regex - Redirect Traffic to new webfolder. URI Redirection on Linux -


there bunch of website files in main web root directory /var/www. want able move these sub folder clean www folder.

the problem

when moved files subfolder website looses track of css, png, jpg , many other files , links on website.

currently sites avaiable in apache2 looks this

 <---/etc/apache2/sites-available---->  rewriteengine on  rewriterule !/.(js|htm;|ico|pdf|css|doc|xls|xml)$ /index.php 

i moved sites contents folder. structure looks like

 /var/www/livesite 

when debugging in webbrowser example warning appears

cannot locate http://192.168.1.5/resources/imgs/file.png

though images resides in http:/192.168.1.5/livesite/resources/imgs/file.png

create /var/www/.htaccess file rule:

rewriteengine on  rewriterule ^(resources/.+)$ /livesite/$1 [l,nc,r=301] 

Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -