mysql - htaccess rewrite subdomain for image directory -


so duplicated , installed existing wordpress site on server , linked subdomain:

sub.domain.com 

after finished work put on main domain problem every image on site has url sub.domain.com/wp-content/... instead of domain.com/wp-content/... , doesnt displayed.

is somehow possible rewrite url using htaccess images displayed or need change every single url on every image via mysql?

my htaccess approach like:

rewriteengine on rewritecond %{http_host} ^(.*)\.domain\.com rewriterule ^(.*)$ http://www.domain.com/$1 [l,nc,qsa] 

if doesnt work, how can in mysql? every link in database automated overwrite

i not use rewrite this. pretty messy. if links stored in db update in mysql. can 1 easy replace command.

update your_table set your_field = replace(your_field, 'http://sub.domain.com', 'http://www.domain.com') your_field '%http://sub.domain.com%' 

always db before doing special updates this.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -