0

我正在处理我的一些项目。我面临的主要问题是通过 .htaccess 重写 url 我只想 使用规则 http://www.domain.com.au/servives.php?alphabet=a写入http://www.domain.com.au/cat/alphabet/a.htmRewriteRule ^cat/alphabet/([^/]+)\.htm$ /services.php?alphabet=$1 [NC,PT]

我的总 .htaccess 文件包含

Options +FollowSymlinks
RewriteEngine on
Options +Indexes
RewriteBase /


//commented// This rule to resolve cononicalization

RewriteCond %{HTTP_HOST} ^domain.com.au
RewriteRule (.*) http://www.domain.com.au/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.domain.com.au/ [R=301,L]
RewriteRule ^cat/alphabet/([^/]+)\.htm$ /services.php?alphabet=$1 [NC,PT]

但是,当我在浏览器中键入http://www.domain.com.au/cat/alphabet/a.htm时,这会打开一个空白页, 但会打开一个空白页,但它包含源代码显示没有错误但仍然是空白的。

如果我添加 [R] 的附加参数,那么它重定向到原始页面外部重定向工作正常。我花了至少一周的时间,很困惑。非常感谢您的帮助。它用这个重定向(带有额外的 R 标志)

RewriteRule ^cat/alphabet/([^/]+)\.htm$ /services.php?alphabet=$1 [NC,R]

为什么它不在内部重定向?

4

0 回答 0