账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    本人用的APACHE环境,需要搭建一个需要NGINX伪静态支持的程序,如何将NGINX伪静态转换成APACHE伪静态?
    81
    0

    用的LINUX宝塔APACHE环境

    只需要LINUX APACHE
    求有技术的大神帮忙转换一下
    或者提供一下对应的工具
    万分感谢
    rewrite ^/index.html$ /index.php;
    rewrite ^/app.html$ /app.php;
    rewrite ^/mv.html$ /mv.php;
    rewrite ^/tv.html$ /tv.php;
    rewrite ^/cx.html$ /cx.php;
    rewrite ^/yy.html$ /yy.php;
    rewrite ^/fun.html$ /fun.php;
    rewrite ^/book.html$ /book.php;
    rewrite ^/yule.html$ /yule.php;
    rewrite ^/hall.html$ /hall.php;
    rewrite ^/fuli.html$ /fuli.php;
    rewrite ^/zhibo.html$ /zhibo.php;
    rewrite ^/music.html$ /music.php;
    rewrite ^/movie.html$ /movie.php;
    rewrite ^/zongyi.html$ /zongyi.php;
    rewrite ^/dongman.html$ /dongman.php;
    rewrite ^/meipai.html$ /meipai.php;
    rewrite ^/shop.html$ /shop.php;
    rewrite ^/vod(.*)$ /play.php?play=$1;
    rewrite ^/mvplay/(.*).html$ /mvplay.php?mv=$1;
    rewrite ^/splay/(.*).html$ /splay.php?xiao=$1;
    rewrite ^/fplay/(.*).html$ /fplay.php?yule=$1;
    rewrite ^/cxplay/(.*).html$ /cxplay.php?id=$1;
    rewrite ^/yplay/(.*).html$ /yplay.php?post=$1;
    rewrite ^/movie_(.)_(.)_(.)_(.)_(.)_(.).html$ /movie.php?cat=$1&year=$2&area=$3&act=$4&rank=$5&pageno=$6;
    rewrite ^/tv_(.)_(.)_(.)_(.)_(.)_(.).html$ /tv.php?cat=$1&year=$2&area=$3&act=$4&rank=$5&pageno=$6;
    rewrite ^/dongman_(.)_(.)_(.)_(.)_(.*).html$ /dongman.php?cat=$1&year=$2&area=$3&rank=$4&pageno=$5;
    rewrite ^/zongyi_(.)_(.)_(.)_(.)_(.*).html$ /zongyi.php?cat=$1&act=$2&area=$3&rank=$4&pageno=$5;
    rewrite ^/gb_(.*).html$ /book.php?page=$1;
    rewrite ^/cx_(.*)_([0-9]+).html$ /cx.php?cid=$1&page=$2;
    rewrite ^/yy_(.*).html$ /yy.php?list=$1;
    rewrite ^/fun_(.*)$ /fun.php?m=$1;
    rewrite ^/yule_(.*)$ /yule.php?m=$1;
    rewrite ^/mv_(.*)$ /mv.php?m=$1;
    rewrite ^/star.html /star.php;
    rewrite ^/mxstar_(.)_(.)_(.*).html /star.php?wd=$1&tab=$2&pageno=$3;
    rewrite ^/seacher-(.*).html /seacher.php?wd=$1;
    rewrite ^/news.html$ /news.php;
    rewrite ^/news_([0-9]+).html$ /news.php?page=$1;
    rewrite ^/content-([0-9]+)-([0-9]+).html$ /content.php?dz=/$1/$2.shtml;
    rewrite ^/shop_(.*)$ /shop.php?page=$1;

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 迊颩、榌舞 普通会员 1楼

      在Apache环境中,要将NGINX的伪静态转换为Apache的伪静态,可以使用以下步骤:

      1. 在Apache的配置文件(通常是httpd.conf或htaccess)中,将要处理的静态资源的URL前缀替换为Apache的默认规则。例如,如果你有一个名为“index.html”的资源,你可以将它设置为“index.php”。

      apache location ~ \.html { try_files $uri $uri/ /index.php?$args; }

      1. 然后,你需要在PHP代码中使用Apache的重定向规则来处理这些请求。例如,你可以使用RewriteEngine on来启用重定向,然后使用RewriteCond %{REQUEST_FILENAME} !-f来确保请求的文件名不是目录,最后使用RewriteRule ^(.*)$ index.php?$1来将请求的文件名替换为对应的文件名。

      ```php

      ```

      这样,当用户访问一个以.html开头的URL时,Apache会将请求重定向到Apache的默认规则中,然后使用PHP处理这个请求。

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部