将rewritebase htaccess移至httpd.conf问题

我遇到了几个小时都无法解决的问题,但仍然没有成功

它正在运行Apache 2.4.38

我可以访问我的某些服务器以尝试对此进行排序,但我只是一个店主

在我的顶级htaccess中,我有以下许多东西,其中包括数千年的分流,因为这家商店已有多年历史了

<IfModule mod_rewrite.c>
RewriteEngine On
#losts of rules like this
RewriteRule  ^(.*)-p-8202.html$ /a-page-on-the-website-p-8243.html? [NC,L,R=301]

#and then towards the bottom of the file
  RewriteBase /   
  RewriteRule ^([a-z0-9/-]+)-p-([0-9]+).html$ product_info.php [NC,QSA]
 RewriteRule ^(.*)-p-([0-9]+).html$ product_info.php [NC,QSA] 
  RewriteRule ^([a-z0-9/-]+)-c-([0-9_]+).html$ index.php [NC,QSA]
  RewriteRule ^(.*)-c-([0-9]+).html$ index.php [NC,QSA]
 RewriteRule ^(.*)-c-([0-9]+)_([0-9]+).html$ index.php [NC,QSA]
  RewriteRule ^(.*)-c-([0-9]+)_([0-9]+)_([0-9]+).html$ index.php [NC,QSA] 
RewriteRule ^([a-z0-9/-]+)-m-([0-9]+).html$ index.php [NC,QSA]
RewriteRule ^([a-z0-9/-]+)-pi-([0-9]+).html$ popup_image.php [NC,QSA]
RewriteRule ^([a-z0-9/-]+)-pr-([0-9]+).html$ product_reviews.php [NC,QSA]
RewriteRule ^([a-z0-9/-]+)-pri-([0-9]+).html$ product_reviews_info.php [NC,QSA]
</IfModule>

现在,我想将所有这些数据移动到虚拟主机中的httpd.conf中,我可以使大多数其他工作正常进行,但不能重写

在httpd.conf中使用它会将所有内容带到索引页或404,将鼠标悬停在正确的位置允许链接

    AllowOverride无     选项全部     要求所有授予          RewriteEngine开     #这样的规则丢失     RewriteRule ^(。*)-p-8202.html $ /a-page-on-the-website-p-8243.html? [NC,L,R = 301]

#and then towards the bottom of the file
 RewriteBase /   
 RewriteRule ^([a-z0-9/-]+)-p-([0-9]+).html$ product_info.php [NC,QSA]
RewriteRule ^(.*)-p-([0-9]+).html$ product_info.php [NC,QSA] 
 RewriteRule ^([a-z0-9/-]+)-c-([0-9_]+).html$ index.php [NC,QSA]
 RewriteRule ^(.*)-c-([0-9]+).html$ index.php [NC,QSA]
RewriteRule ^(.*)-c-([0-9]+)_([0-9]+)_([0-9]+).html$ index.php [NC,QSA]
 RewriteRule ^([a-z0-9/-]+)-pi-([0-9]+).html$ popup_image.php [NC,QSA]
 RewriteRule ^([a-z0-9/-]+)-pr-([0-9]+).html$ product_reviews.php [NC,QSA]
 RewriteRule ^([a-z0-9/-]+)-pri-([0-9]+).html$ product_reviews_info.php [NC,QSA]
</IfModule>

这是myhttpd目录conf

<Directory />
    Options None
AllowOverride None
</Directory>

<Directory /home>
    AllowOverride All
    Options -MultiViews -Indexes +FollowSymLinks +IncludesnoExec +Includes
    AllowMethods GET HEAD POST
</Directory>

Include /etc/httpd/conf/extra/httpd-hostname.conf

<Directory /var/www/cgi-bin>
    AllowOverride None
    Options None
    Require all granted
</Directory>

尝试了许多不同的选项,太多了,无法列出,尽管我可以使大部分事情都有效,但我无法使上面的工作起作用,这是整个网站结构的基础,但是有许多htaccess文件在整个网站上,我可以使每个人都进入相关的httpd.conf目录,并与allowoveride一起使用

任何想法都会受到赞赏,尽管我的知识有限,所以请保持基础

yunmengyi 回答:将rewritebase htaccess移至httpd.conf问题

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2877421.html

大家都在问