Boo*_*eus 14
从父文件夹创建symblink:
使用ssh或plesk或cpanel:
shell:/path/to/www/mobile> ln -s ../js/
shell:/path/to/www/mobile> ln -s ../images/
shell:/path/to/www/mobile> ln -s ../css/
etc...
Run Code Online (Sandbox Code Playgroud)
这将从您的主站点创建一个符号链接,因此您只需从主站点上传文件,并自动更新移动设备.
因此,当您访问/js/file.js移动网站时,它将查找主要的symblink /js/file.js.
此外,我建议使用此规则(从您的主站点 - .htaccess),以防/mobile/从机器人或用户访问.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com$ [NC]
RewriteRule ^mobile/?$ http://m.dom.com/ [R=301]
Run Code Online (Sandbox Code Playgroud)
使用CSS修改内容,这样您就不必再创建两次相同的内容了
| 归档时间: |
|
| 查看次数: |
145 次 |
| 最近记录: |