Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 子文件夹访问的重写规则_Php_.htaccess - Fatal编程技术网

Php 子文件夹访问的重写规则

Php 子文件夹访问的重写规则,php,.htaccess,Php,.htaccess,我的url博客在这里 我的帖子应该如下所示。博客之后/ 为什么不起作用 这是htaccess Options +FollowSymLinks RewriteEngine On # FOR LOCALHOST RewriteBase /tibiaservers_11.10.19/ # FOR PRODUCTION RewriteBase / RewriteBase /tibiaservers_11.10.19/ DirectoryIndex index.php #

我的url博客在这里

我的帖子应该如下所示。博客之后/

为什么不起作用

这是htaccess

   Options +FollowSymLinks






RewriteEngine On

# FOR LOCALHOST RewriteBase /tibiaservers_11.10.19/
# FOR PRODUCTION RewriteBase /

RewriteBase /tibiaservers_11.10.19/ 

DirectoryIndex index.php

# przekierowanie na bez www

#RewriteCond %{HTTP_HOST} ^www\.tibiaservers\.net$
#RewriteRule ^/?$ "http\:\/\/tibiaservers\.net\/" [R=301,L]

<IfModule mod_rewrite.c>



# For Blog

RewriteRule ^blog/t-(.*)$ tagpost.php?id=$1 [L]
RewriteRule ^blog/c-(.*)$ catpost.php?id=$1 [L]
RewriteRule ^blog/a-(.*)-(.*)$ archives.php?month=$1&year=$2 [L]

# RewriteCond %{REQUEST_FILENAME} !-d [NC]
# RewriteCond %{REQUEST_FILENAME} !-f [NC]

RewriteRule ^blog/(.*)$ viewpost.php?id=$1 [QSA,L]

##### - blog end
Options+FollowSymLinks
重新启动发动机
#对于LOCALHOST RewriteBase/Server_11.10.19/
#生产基地/
重写BASE/U 11.10.19/
DirectoryIndex.php
#przekierowanie na bez www
#重写cond%{HTTP_HOST}^www\.server\.net$
#重写规则^/?$“http\:\/\/server\.net\/”[R=301,L]
#博客
重写规则^blog/t-(*)$tagpost.php?id=$1[L]
重写规则^blog/c-(*)$catpost.php?id=$1[L]
重写规则^blog/a-(.*)-(.*)$archives.php?月=1美元,年=2美元[L]
#重写cond%{REQUEST_FILENAME}-d[NC]
#重写cond%{REQUEST_FILENAME}-f[NC]
重写规则^blog/(*)$viewpost.php?id=$1[QSA,L]
#####-博客结束

我认为你的
重写规则应该从:
^U 11.10.19/

这:

RewriteRule ^tibiaservers_11.10.19/blog/t\-(.*)$ tagpost.php?id=$1 [L]
将与此url匹配:

http://localhost/tibiaservers_11.10.19/blog/t-asdf

我使用此工具测试.htaccess规则:

仍不工作错误404。需要重写规则中的I/U 11.10.19/,如果RewriteBase有/U 11.10.19/?请尝试描述您正在做的事情,而不是发布视频。很难理解视频中发生了什么。此外,当发布代码时,请使用格式化程序使其可读,就像我在回答中所做的那样。“这是htaccess”-是的,但它在哪里?它在哪个文件夹中?