zoukankan      html  css  js  c++  java
  • apache 伪静态配置

    1  现配置站点,

    <VirtualHost *:80>

    //访问名称

    ServerName my.seo_demo.com

    //项目地址

    DocumentRoot "/Users/lijundong/Documents/SeoDemo"

    //默认访问文件类型

    DirectoryIndex index.html index.php

    //错误日志存放地址

    ErrorLog "/Users/lijundong/Documents/SeoDemo/logs"

     // 以上为网站主要配置,下面是配置访问权限和网站其他伪静态等配置

    <Directory "/Users/lijundong/Documents/SeoDemo">

    //配置开不开启,目录列表

    Options -Indexes +FollowSymlinks

    //配置启用Rewrite 

    AllowOverride All

    Require all granted

    //设置都可以访问 ,Deny from all 都不可访问,还有order Allow Deny 设置访问 去中间差值

    Allow from all

    </Directory>

     </VirtualHost>

    directory 中没有配置的项 apache都会以父级中的配置为主

    2  cd /etc/hosts 中配置 127.0.0.1  xxx.xxx.cxx

    3  开启apache Rewrite模块

    LoadModule rewrite_module libexec/apache2/mod_rewrite.so  只要取消前面注视即可

    4  然后配置.htaccess文件

        文件内容为: 

          <IfModule rewrite_module> //是否存在该配置 相当于if else语句

          RewriteEngine On //开启rewrite

          RewriteRule  (d+).html$ index.php  //规则  此规则表示 然后以数字.html 都会访问index.php

          <IfModule>

    5  语句中的配置也可以写在httpd.cong 的该站点配置的directory 中;

    知识点来自:http://www.iqiyi.com/w_19rqqdt2ol.html#curid=1751966709_231918daaf7a28d60b4427cccb8c42de

  • 相关阅读:
    Microsoft NNI入门
    【神经网络搜索】Efficient Neural Architecture Search
    Sphinx 快速构建工程文档
    Ubuntu16.04 Cuda11.1 Cudnn8.1 Tensorflow2.4 PyTorch1.7环境配置
    【CV中的Attention机制】ShuffleAttention
    【有趣的NAS】NAS-RL(ICLR2017)
    分类器
    将url下载到本地
    缓存管理器
    大数据数据结构-分类模型
  • 原文地址:https://www.cnblogs.com/jackylee92/p/5762509.html
Copyright © 2011-2022 走看看