Ubuntu 14.04LTS 32bit
灯
我知道这是一个老问题,但..
我需要它从可见网址中找到它的任何地方删除.php。 它需要使用/showthread.php?id=XX ---> / showthread?id = XX
我甚至无法使用它 /page.php
- > /page
。
我试过这些:
如何使用Apache mod_rewrite隐藏.html扩展名
它什么都不做。
其他 .htaccess
代码工作正常..
而
<?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
尝试了更多的东西
# 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 ^(.*)$ $1/ [R=301,L]
# Remove .php-extension from url
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^\.]+)/$ $1.php
# End of Apache Rewrite Rules
</IfModule>
#
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.php [NC,L]
#
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
这甚至没有任何影响:
RewriteRule ^page$ page.php [L]
sudo service apache2 restart
什么都不改变。
服务器重启不会改变任
我尝试清除其他代码,没有做任何改动。
我清除了浏览器缓存100次
我开始认为它只是讨厌我。有什么可能导致这个?