手动 mod_rewrite 每页

Manually mod_rewrite each page

我尝试了这个世界上的一切来让它正常工作,但就是不行。我完成了自动重写。如果您认为您知道可能导致此问题的原因,您仍然可以回答,但我怀疑这是否可能。

问题: 我如何继续 手动 mod_rewrite 每个页面,如下所示:

domain.com/showthread.php?id=00domain.com/showthread?id=00

(我之前问过 () 如何自动重写它,但我就是无法让它正常工作,而且我 运行 没有时间和精力。还有咖啡。)

问题:

尽管

<?php 
phpinfo();

列出 mod_rewrite 已启用

<?php
 if(!function_exists('apache_get_modules') ){ phpinfo(); exit; }
 $res = 'Module Unavailable';
 if(in_array('mod_rewrite',apache_get_modules())) 
 $res = 'Module Available';
?>
<html>
<head>
<body>
<p><?php echo apache_get_version(),"</p><p>mod_rewrite $res"; ?></p>
</body>
</html>

显示 "Module Available"

..它仍然不起作用。

我尝试了以下 a.o.:

(1)
# Apache Rewrite Rules
 <IfModule mod_rewrite.c>
  Options +FollowSymLinks
  RewriteEngine On
  RewriteBase /

# Add trailing slash to url
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$
  RewriteRule ^(.*)$ / [R=301,L]

# Remove .php-extension from url
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME}\.php -f
  RewriteRule ^([^\.]+)/$ .php 

# End of Apache Rewrite Rules
 </IfModule>
(2)
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^\.]+)$ .php [NC,L]
(3)
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ .php
(4)
RewriteRule ^page$ page.php [L]

备注:

注意:

请在回答前阅读post。我很确定这不是您的一般 mod_rewrite 问题。

我想您的 htaccess 根本无法正常工作。检查以下 apache conf 文件 ... 允许覆盖 None ...

并将其更改为 AllowOverride All