Author Topic: 【天问】不懂程序如何做一个个人网站或企业网站(域名、主机、备案、SEO、CMS)  (Read 4484 times)

laofuzi

  • Hero Member
  • *****
  • Posts: 5083
一般做网站的主要工作如下:

1)购买主机:
个人网站和一般的企业展示网站,只需要一个虚拟主机即可,一年才200多块钱。面向国内的,主要用国内主机(因为用国外主机的话,国内访问网页非常慢),面向国际客户的既可以用国内主机,也可以用国外主机(可能国外主机国外客户访问会快一些)。note:这里郑重提醒,一定要购买大企业的虚拟主机,一年几百块钱还不够一顿饭钱,其他小企业的主机再便宜也便宜不到哪里去,大型企业主机管理比较规范,不会随意被网络攻击出网络故障或者随意关停网站。对于网站来说,稳定是最主要的,只有稳定才能保证访问量。我接触过的主机有2个,一个是阿里云主机,优点稳定,缺点售后等于无,售后工程师从来不解决问题。而美国的A2hosting主机,缺点就是国内访问上去太慢,但是售后服务是真好,连程序都能给你调,服务真好!!国内和国外的主机价格都差不多。推荐在国内双11和国外黑色星期五的购物节时间购买,都有折扣。
购买主机后,会有ftp用户名、ftp密码、数据库用户名、数据库名、数据库密码、主机或服务器(数据库的那个临时网址,一般主机参数那有ftp的一个临时域名,还有数据库的一个临时域名,这里服务器要填数据库的。比如dmxxxx.my3w.com)

2)购买域名:

域名一般在国内购买,比如在阿里云平台。一般购买.com 和.cn域名,55元和29元每年。便宜的要死。目前所有两个字的域名都已经被注册,要注册只能注册三个字的域名了。比如xiongmao.com肯定是被注册的,但是laoxiongmao.com可能还有。

3)域名工信部管局备案:
如果购买的国外主机,则不用进行域名管局备案,如果购买的是国内主机,则必须进行管局备案。不备案是不可以接入的。备案周期是3个礼拜左右。需要提交身份证、照片。具体的要求和说明,在阿里云的备案系统很详细。note:注意域名必须在备案人的名下,比如张三购买的域名是属于张三名下的,如果用李四去备案,则域名先转到李四名下,这个转移过程在域名那有相关操作,一分钟就能完成,很简单。另外,新购买的域名最好等上3-5天再去备案,因为新购买的域名需要时间同步到工信部的审核池中。网上碰到很多备案操作太快,结果到了管局,管局查不到这个域名,被退回重新走备案流程。

note:如果是企业备案,会在工信部备案的基础上,再进行公安局备案,也简单
公安备案审核通过后,您需在30日内登录全国公安机关互联网站安全管理服务平台,在您的已备案网站详情中,复制网站公安机关备案号,下载备案编号图标,复制备案编号 HTML 代码,并编辑您的网页源代码。

具体请参考该文档:https://cloud.tencent.com/document/product/243/19142
http://www.90zhanzhang.net/?post=20

源代码如下(需要先上传公安局图标,然后把如下源代码中图标的位置修改一下)



4)安装网站程序:
以前是自己写程序上传,现在网上到处是各种现成的CMS(内容管理系统),CMS是各种开源的程序,国内的,国外的,数不胜数,不过国内的界面都很丑,国外的相对漂亮。都是免费的。下载下来后,用FlashFXP代码上传工具上传到购买主机,然后按照CMS程序的install教程一步一般安装(这里要用到主机的参数,在购买主机部分有特别写明)。安装好后,就可以用备案的域名访问(如果还没备案好,就用ftp的那个临时域名安装和访问。如果用域名直接访问,还有一些解析和绑定的步骤)。
note:安装要安装在主机的/htdocs/文件下(有的主机可能是public—)。这里提醒一下,不懂程序的人请一定先备案再安装程序,安装程序的时候用购买的域名进行安装。否则,用临时域名安装的,后面还要到程序中把临时域名改成购买域名。这个对一般人就复杂了。如果真的用临时域名安装的,请用flashfxp把安装后的程序都下载下来,然后用notepad进行文件夹的检索(搜索-查找-文件查找),凡是出现临时域名的地方都改成购买域名,再重新把修改的文件替换掉主机里的相关文件。对于smf程序,只需要使用repair_settings.php文件即更改所有需要修改的地方,不需要使用notepad。



note:安装程序之前一定要查看程序的php版本要求及数据库的版本要求,比如要求php7.2,你就需要在万网主机管理平台php版本设置里改成7.2的版本。默认可能是7.0,安装的时候不改就会报错。

5)域名解析和主机绑定:
如果域名备案好后,需要对域名进行解析到主机,同时需要对主机绑定域名。这是两个步骤,缺一不可。
域名解析如果不用使用带域名的邮箱,则只需要解析两个解析记录(A-www-主机IP)和(A-@-主机ip)。详细的在域名解析的时候有说明。如果要使用带域名后缀的邮箱,则还需要解析其他记录(比如腾讯企业邮箱)。
域名绑定主机,则只需要在主机里的域名管理中添加域名即可实现绑定。很简单。

note:现在阿里云虚拟主机只提供CNAME地址,不对外显示IP,但是在主机的备案管理申请备案号那里可以看到IP。
云虚拟主机的域名解析一般有两种,为域名添加A解析记录和CNAME解析记录:

添加A解析记录,表示将域名指向IP地址。
添加CNAME解析记录,表示将域名指向另一个域名,再由另一个域名提供IP地址。

https://help.aliyun.com/knowledge_detail/50986.html?spm=5176.10695662.1996646101.searchclickresult.48b52ba88gvPzd


如果是美国的主机,还要改DNS服务器(改成美国的DNS服务器),
DNS修改 / expressentry.cn
DNS修改,是指将当前域名的解析DNS服务器更换为其他的DNS服务器,由修改后的DNS服务器负责域名解析服务。
当前DNS服务器
修改DNS服务器
同步
ns3.a2hosting.com
ns4.a2hosting.com
ns1.a2hosting.com
ns2.a2hosting.com

6)正常访问:
现在就可以使用www.xxx.com来访问你安装的程序了。然后补充自己的网站内容。后面网站有没有访问量,就看内容质量了,内容才是王!

7)网站提交搜索引擎:
网站补充了内容后,最开始搜索引擎比如百度,是检索不到网站的,可能至少需要好几个月甚至半年才可能检索到网站。为了早点让搜索引擎检索到,可以主动把网站提交上去,好让他们早点发现网站的存在,而不用等他们来主动来爬。比如百度提交网站:https://ziyuan.baidu.com/linksubmit/url?sitename=http%3A%2F%2Fnewtianwe.com。其他搜索引擎360,搜狗,google,bing类似。

8)SEO优化:
为了提高访问量,怎么把网页排在浏览器的更靠前的位置,首先是内容为王,在内容相同的情况下,就看seo技巧了。但是这个既复杂又简单。对于普通的人,于其折腾技巧,还不如多发一些原创的有质量的文章。

« Last Edit: September 02, 2021, 08:18:19 AM by laofuzi »
发达国家无犯罪证明Police Certificate/Criminal Record/海牙认证/使馆认证:www.newnewdoc.com 加拿大技术移民:www.newnewland.com  微信咨询:newnewlandvisa

laofuzi

  • Hero Member
  • *****
  • Posts: 5083
How to import and export a MySQL database

https://www.a2hosting.com/kb/developer-corner/mysql/import-and-export-a-mysql-database#a-nameprocExportDBaHow-to-export-a-MySQL-database

网站迁移:比如换一个主机空间商。

https://docs.cmsmadesimple.org/moving



How to move your CMS Made Simple installation to a new server (method 1)

It is a simple, four step process to move your installation from one server to another.
Step 1

Clear the Cache:
Login to admin, go to Site Admin/System Maintenance and clear the cache. This reduces the number of files you need to copy.
Step 2

Move the Database:
Using PhpMyAdmin, or any other database management software, create a backup/export of your CMSMS database. Use this backup/export to create/import a new database on the new server.

It's important that you leave out the option to "create database" if it is available, as it is unlikely that the destination database name will be he same as the source database name. However, you must ensure that the export file will "create tables".
Step 3

Copy the Files:
Using SSH, your host's control panel, or FTP, copy all of the files from your old site to your new site. Remember to check the permissions for the folders on the new site to ensure they are set correctly, i.e. all cache, uploads and any other folders or sub-folders that need to be writable, are writable.

    modules
    tmp
    tmp/templates_c
    tmp/cache
    uploads
    uploads/images

If using FTP remember to copy all files in "binary" mode. Do not enable auto-file type detection, or ASCII mode.
Step 4

Modify config.php:
In the config.php file on the destination host, find the Database Settings, Path Settings and Image Settings sections and update them with the paths and settings applicable to the new server.

Recent versions of CMSMS use a sparse configuration file. Many paths and URLs if not specified in the configuration file are auto calculated. This means that when moving a site you may only need to change the database connection settings in the config.php. If experiencing problems you can override the auto-calculation by specifying the values in the config.php. See the CMSMS_Config_Reference.pdf file that is included in the docs directory of every installation since CMSMS 1.10 for a reference of config variables and their function.

The path settings are not always that obvious. In your FTP-client it might show something like '/cmsmadesimple' but the real path on the server might be something like e.g.: '/home/content/n/e/e/username/html/cmsmadesimple'. If you have the wrong path, look at the error-message when you try to access your site, that will hint you to the real path settings.

It may be necessary to clear cache again...


phpmyadmin数据库导入的使用方法:


phpmyadmin就是一种mysql的管理工具,安装该工具后,即可以通过web形式直接管理mysql数据,而不需要通过执行系统命令来管理,非常适合对数据库操作命令不熟悉的数据库管理者,下面我就说下怎么安装该工具:

1.先到网上下载phpmyadmin,再解压到可以访问的web目录下(如果是虚拟空间,可以解压后通过ftp等上传到web目录下),当然您可以修改解压后该文件的名称。

2.配置config文件
  打开libraries下的config.default.php文件,依次找到下面各项,按照说明配置即可:


A.访问网址
$cfg['PmaAbsoluteUri'] = '';这里填写phpmyadmin的访问网址
如:$cfg['PmaAbsoluteUri'] = 'http://www.piaoyi.org/phpmyadmin/';
这里因为我是本地调试,我改为$cfg['PmaAbsoluteUri'] = 'http://localhost/phpmyadmin/';
注意:不要漏掉最后的反斜杠/和开头的http。

B.mysql主机信息

$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address
填写localhost或mysql所在服务器的ip地址,如果mysql和该phpmyadmin在同一服务器,则按默认localhost
$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port
mysql端口,如果是默认3306,保留为空即可

C.mysql用户名和密码

$cfg['Servers'][$i]['user'] = 'root'; // MySQL user 访问phpmyadmin使用的mysql用户名
fg['Servers'][$i]['password'] = ''; // MySQL password (only needed对应上述mysql用户名的密码

 

D.认证方法
$cfg['Servers'][$i]['auth_type'] = 'cookie';
在此有四种模式可供选择,cookie,http,HTTP,config
   config方式即输入phpmyadmin的访问网址即可直接进入,无需输入用户名和密码,是不安全的,不推荐使用。
   当该项设置为cookie,http或HTTP时,登录phpmyadmin需要数据用户名和密码进行验证,,具体如下:
   PHP安装模式为Apache,可以使用http和cookie;
   PHP安装模式为CGI,可以使用cookie
   我个人建议:无论是本地还是网络上,都建议设置成cookie,安全第一。

 

E.短语密码(blowfish_secret)的设置
$cfg['blowfish_secret'] = '';
如果认证方法设置为cookie,就需要设置短语密码,置于设置什么密码,由您自己决定  ,但是不能留空,否则会在登录phpmyadmin时提示错误

 

F.设置默认语言与编码
查找 $cfg['DefaultLang'] = 'zh'; (这里是选择语言,zh代表简体中文的意思) 还有 $cfg['DefaultCharset'] = 'gb2312';(修改默认编码为国标)

  好了,到此为止,您已经成功安装了phpmyadmin,简单吧 ,赶快登录体验下吧

说明:
该文档说明的只是安装phpmyadmin的基本配置,关于config.default.php文件中各个配置参数的详细说明可以参考:

http://www.cnblogs.com/vit4/archive/2012/10/26/2741768.html

虚拟主机中phpMyAdmin的安装配置方法,请见:

http://www.cnblogs.com/vit4/archive/2012/10/26/2741789.html
« Last Edit: August 31, 2021, 12:36:41 PM by laofuzi »
发达国家无犯罪证明Police Certificate/Criminal Record/海牙认证/使馆认证:www.newnewdoc.com 加拿大技术移民:www.newnewland.com  微信咨询:newnewlandvisa

laofuzi

  • Hero Member
  • *****
  • Posts: 5083
本文为您介绍将本地数据库的SQL文件导入云虚拟主机数据库的多种方法。

请您与网站开发商或网站制作人员确认您的网站使用的数据库类型,然后根据不同的数据库类型,选择对应的导入方法:

    使用MySQL数据库,您可以通过以下方式导入本地SQL文件:
        通过数据管理DMS导入文件,具体操作,请参见通过DMS导入数据库文件。
        通过Navicat导入文件,具体操作,请参见通过Navicate for MySQL导入SQL文件。
        通过MySQL Command Line Client导入文件,具体操作,请参见通过MySQL Command Line Client导入SQL文件。
    使用SQL Server数据库,您可以通过以下方式导入本地SQL文件:
        通过数据管理DMS导入文件,具体操作,请参见通过DMS导入数据库文件。
        通过SQL Server Management Studio 2008导入文件,具体操作,请参见导入SQL Server数据库的数据。
    使用Access数据库,请通过FTP客户端将数据库文件和网页文件一起上传至云虚拟主机网站根目录即可。

说明 建议您使用数据管理DMS导入本地数据库SQL文件,与其他方法相比,无需在本地安装MySQL数据库或第三方客户端等工具,操作更方便。


您可以通过数据管理DMS将本地的SQL文件和CSV文件导入云虚拟主机的数据库。本文以云虚拟主机MySQL数据库为例介绍导入本地SQL文件的方法。
背景信息

将本地的SQL文件或CSV文件导入云虚拟主机的SQL Server数据库时,操作方法与本文类似,请根据实际操作界面做相应的步骤调整。
操作视频
操作步骤

    登录云虚拟主机MySQL数据库。
    具体操作,请参见通过数据管理DMS Web版本登录数据库。
    在顶部菜单栏,单击导入。
    DMS-1
    在导入页面,单击新增任务。
    在弹出的导入任务(文件类型支持CSV、SQL、ZIP格式)对话框,配置完导入文件的信息,单击开始。
    DMS-设置连接

    主要参数的配置说明,如下所示:
        文件类型:请根据待导入的本地数据文件格式选择SQL或CSV。本例中选择SQL。
        文件字符集:请根据您待导入文件的字符集类型选择对应格式。本例中选择自动判定。
        数据库:请选择云虚拟主机数据库名。
        附件:请选择保存在本地的待导入文件。
    说明 本地数据文件较大时,建议您先压缩数据文件再上传。关于压缩文件的要求,请您单击页面的文件上传说明了解详细规则。

执行结果

SQL文件导入成功,如下图所示。
导入成功

在左侧导航栏,右键单击空白处,选择刷新,您可以看到导入成功的表。
表成功导入



----------------
网上有的说阿里云不兼容phpmyadmin。导致安装不上。phpmyadmin光上传到根目录就用了好几个小时。结果怎么配置都找不到服务器。感觉也不是,下面是阿里云的操作指导:


云虚拟主机通过phpMyAdmin管理MySQL4

phpMyAdmin是一款基于Web的MySQL数据库管理工具,您可以通过它执行创建和删除数据库、创建和修改表格、运行SQL脚本等操作。本文以phpMyAdmin 2.11.11.3为例介绍连接Linux操作系统云虚拟主机MySQL数据库的方法。
前提条件

    已下载phpMyAdmin。

    您可以前往phpMyAdmin官网下载。
    已安装FTP客户端。

    建议您使用FileZilla,更多信息,请参见使用FileZilla管理文件。

操作步骤

    获取数据库信息。
        登录云虚拟主机管理页面。
        找到待获取数据库信息的云虚拟主机,单击对应操作列的管理。
        在左侧导航栏单击数据库信息。
        在数据库信息页面,获取数据库信息。
        说明 如果您忘记数据库密码,可以重置密码。具体操作,请参见重置云虚拟主机数据库密码。
        公用-获取数据库信息-豪华增强版Linux
    配置phpMyAdmin的数据库连接信息。
        在本地主机解压缩phpMyAdmin压缩包。
        找到phpMyAdmin目录下的数据库连接配置文件config.inc.php,修改文件中的数据库连接信息。
        config.inc.php示例如下所示:

        /* Server xxx.my3w.com (config:xxx) [1] */
        $i++;
        $cfg['Servers'][$i]['auth_type'] = 'cookie';
        $cfg['Servers'][$i]['host'] = '云虚拟主机数据库地址';
        $cfg['Servers'][$i]['extension'] = 'mysql';
        $cfg['Servers'][$i]['connect_type'] = 'tcp';
        $cfg['Servers'][$i]['compress'] = false;
        $cfg['Servers'][$i]['controluser'] = '云虚拟主机数据库用户名';
        $cfg['Servers'][$i]['controlpass'] = '云虚拟主机数据库密码';
        $cfg['Servers'][$i]['user'] = '云虚拟主机数据库用户名';
        $cfg['Servers'][$i]['password'] = '云虚拟主机数据库密码';

        使用获取的云虚拟主机数据库信息替换代码中的对应字段即可。
        将phpMyAdmin的安装文件重新压缩打包。
    使用FTP客户端上传phpMyAdmin压缩包到Linux操作系统云虚拟主机的网站根目录/htdocs下,然后解压缩phpMyAdmin压缩包。
    具体操作,请参见上传压缩文件和解压缩文件。
    在本地主机的浏览器地址栏中输入域名/phpMyAdmin,单击回车。
    在phpMyAdmin的登录框中,输入数据库用户名和密码,单击执行。
    登录phpmyadmin

执行结果

成功登录phpMyAdmin后,您可以管理云虚拟主机的MySQL数据库。
« Last Edit: September 01, 2021, 10:27:45 AM by laofuzi »
发达国家无犯罪证明Police Certificate/Criminal Record/海牙认证/使馆认证:www.newnewdoc.com 加拿大技术移民:www.newnewland.com  微信咨询:newnewlandvisa

laofuzi

  • Hero Member
  • *****
  • Posts: 5083
最终结论:

阿里云也支持phpmyadmin!当然,阿里云也可以用他们自己的DMS数据库管理工具,直接导入导出。(网络地址:3306)



下载phpMyAdmin后先fpt上传到根目录,然后替换如下两个文件。
/htdocs/phpMyAdmin/config.inc.php
/htdocs/phpMyAdmin/libraries/config.default.php
访问网址:http://wh-xxxxx.my3w.com/phpMyAdmin/(修改配置时使用这个url) 而不是http://www.wh-xxxxx.my3w.com/phpMyAdmin/,后者访问找不到服务器。


/* Server xxx.my3w.com (config:xxx) [1] */
$i++;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['host'] = '云虚拟主机数据库地址';------网上都让写local host或IP,但是实际上填写数据库地址。上面两个文件都是这样填写。
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['controluser'] = '云虚拟主机数据库用户名';
$cfg['Servers'][$i]['controlpass'] = '云虚拟主机数据库密码';

下面两个应该是config.default.php中。
$cfg['Servers'][$i]['user'] = '云虚拟主机数据库用户名';----是数据库,不是ftp
$cfg['Servers'][$i]['password'] = '云虚拟主机数据库密码';


note:$cfg['blowfish_secret'] 两个配置都留空了,用的就是cookie

感觉最这里面最关键的就是url和host,user和password写对。




最后如果根据url进入phpmyadmin提示php版本问题,就在万网后台修改空间的php版本。

« Last Edit: September 01, 2021, 11:33:19 AM by laofuzi »
发达国家无犯罪证明Police Certificate/Criminal Record/海牙认证/使馆认证:www.newnewdoc.com 加拿大技术移民:www.newnewland.com  微信咨询:newnewlandvisa

laofuzi

  • Hero Member
  • *****
  • Posts: 5083
Your domain already has an active SSL:(先要验证空间是否支持ssl(newnewland.com就没有ssl

https://www.sslshopper.com/ssl-checker.html#hostname=newnewland.cn%20

But you will need to use this manual to set up a proper https rewrite rule:

https://www.a2hosting.com/kb/security/ssl/redirecting-users-to-ssl-connections



Add the following lines to the desired .htaccess file to redirect users from a non-secure URL (http://) to a secure URL (https://).

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]




发达国家无犯罪证明Police Certificate/Criminal Record/海牙认证/使馆认证:www.newnewdoc.com 加拿大技术移民:www.newnewland.com  微信咨询:newnewlandvisa

laofuzi

  • Hero Member
  • *****
  • Posts: 5083
发达国家无犯罪证明Police Certificate/Criminal Record/海牙认证/使馆认证:www.newnewdoc.com 加拿大技术移民:www.newnewland.com  微信咨询:newnewlandvisa

laofuzi

  • Hero Member
  • *****
  • Posts: 5083
Hosting - How do I move my SMF forum to a different host
The move consists of ten steps:

Step 1 - Prepare by checking whether you have an SSL cert. You should also discuss transfer and installation with your new host.
Step 2 - Make a file system backup.
Step 3 - Make a database backup at the same time to ensure that the two backups are in sync.
Step 4 - Restore the files and the database within the target system. Note that restoring the files and database can be a substantial and time consuming task and that some hosts have size limitations on restoring these. Large databases can sometimes pose a challenge and your import will not complete due to size constraints. Some of the strategies that can be employed for managing a forum with a large databases are as follows:
Clear the error log before carrying out the database backup.
Clear the search index (where the largest tables are often located) before carrying out the database backup and rebuild the search index once your forum is functional.
A SQL file splitter can help because it breaks the database backup into smaller pieces.
If you encounter problems ask your new host to carry out this step.

Step 5 - Run repair_settings.php on the new system to ensure that your paths, URLs, and database credentials are correct.
Step 6 - Carefully inspect any redirects that may exist in either .htaccess or index.html to ensure that they are not referencing old directory/file structures.
Step 7 - Inspect the settings for each mod that you have installed. Look for folders or URLs that need updating. Repair_settings.php does not update mod settings, so you have to identify these and update them yourself.
Step 8 - As a safety measure and to ensure that everything is linked together correctly, it is recommended that you run the forum database maintenance function, the 'find and fix any errors' maintenance function, and the attachment integrity check. If any of these generate errors it means that something has gone wrong.
Step 9 - Coordinate the IP address change with your registrar. Note this takes time and may make the forum inaccessible for a while.
Step 10 - If you use Google or Bing webmaster tools, or if you have a robot.txt file, you should confirm they are working as expected after the site migration has taken place.



SMF迁移教程:
https://wiki.simplemachines.org/smf/Hosting_-_How_do_I_move_my_SMF_forum_to_a_different_host
发达国家无犯罪证明Police Certificate/Criminal Record/海牙认证/使馆认证:www.newnewdoc.com 加拿大技术移民:www.newnewland.com  微信咨询:newnewlandvisa

laofuzi

  • Hero Member
  • *****
  • Posts: 5083
301重定向(主页---》主页)阿里云还需要备案才能重定向

Thank you for your question, I understand you would want to know if it is possible to redirect a sample URL www.abc.com/xxx/xxx to www.123.com. I will do my best to provide more insight here.

I believe this situation can be achieved with .htaccess. The below link describes a similar situation with a solution. Please try it out and let us know if it was helpful.

https://stackoverflow.com/questions/8416042/htaccess-redirect-all-pages-under-a-folder-to-new-domain

Feel free to contact us if you encounter further issues, we are committed to always assist you.

.htaccess redirect all pages under a folder to new domain
Asked 9 years, 9 months ago
Active 9 years ago
Viewed 30k times
14
8

I have some files placed under a particular folder in my old domain like this: http://www.olddomain.com/folder1/.

I want to redirect all requests that try to access files under this folder to a new domain. Example: http://www.olddomain.com/folder1/page1.html -> http://www.newdomain.com/page1.html

How do I accomplish this using .htaccess?


<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteRule ^folder1(.*)$ http://www.newdomain.com/$1 [L,R=301]

</IfModule>



----------------------
网络:
首先到域名注册商那里,将域名解析到新域名所在的服务器ip上面,也可以直接用cname的形式解析到新域名上面。然后再到服务器供应商那边(也就是新域名的服务器管理后台),将老域名绑定上去。这样做之后,使用老域名也可以访问新域名的网站内容了。如果想要放弃老域名,只使用新域名的话,还需要做一下301重定向,这样做的目的,就是当用户访问老域名的时候,会直接跳转到新域名中去。服务器后台提供的301重定向,一般只能重定向首页,如果想要全站都实现重定向的话(即访问老域名的一个文章页网址,会自动跳转到新域名对应的文章页网址),还需要对网站程序进行一下修改,即上面提到的: $S$Q这种格式(这个你们得找技术来解决了)

那就是做全站301了。要写个什么文件? RewriteEngine On RewriteCond %{http_host} ^xxxxxx.com [NC] RewriteRule ^(.*)$ http://www.xxxxxx.com/$1 [L,R=301] 类似这样的?

    2018-06-12 16:06

夜色太美
夜色太美

全站301 百度搜一下 比较多,直接放共用的头部文件就可以。

http://www.yelook.com/386.html
发达国家无犯罪证明Police Certificate/Criminal Record/海牙认证/使馆认证:www.newnewdoc.com 加拿大技术移民:www.newnewland.com  微信咨询:newnewlandvisa