删除php文件扩展名后出错

时间:2016-01-25 08:41:00

标签: php .htaccess server-side-scripting

所以我在我的网站文件夹的根目录中有一个.htaccess

[ec2-user@ip-172-31-1-237 memcached-2.2.0]$ sudo yum install php-devel
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/latest                                                                         | 2.1 kB     00:00
amzn-updates/latest                                                                      | 2.3 kB     00:00
Resolving Dependencies
--> Running transaction check
---> Package php-devel.x86_64 0:5.3.29-1.8.amzn1 will be installed
--> Processing Dependency: php(x86-64) = 5.3.29-1.8.amzn1 for package: php-devel-5.3.29-1.8.amzn1.x86_64
--> Processing Dependency: libgmp.so.3()(64bit) for package: php-devel-5.3.29-1.8.amzn1.x86_64
--> Running transaction check
---> Package compat-gmp4.x86_64 0:4.3.2-1.14.amzn1 will be installed
---> Package php.x86_64 0:5.3.29-1.8.amzn1 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.29-1.8.amzn1 for package: php-5.3.29-1.8.amzn1.x86_64
--> Processing Dependency: httpd-mmn = 20051115 for package: php-5.3.29-1.8.amzn1.x86_64
--> Processing Dependency: php-cli(x86-64) = 5.3.29-1.8.amzn1 for package: php-5.3.29-1.8.amzn1.x86_64
--> Running transaction check
---> Package httpd.x86_64 0:2.2.31-1.6.amzn1 will be installed
--> Processing Dependency: httpd-tools = 2.2.31-1.6.amzn1 for package: httpd-2.2.31-1.6.amzn1.x86_64
--> Processing Dependency: apr-util-ldap for package: httpd-2.2.31-1.6.amzn1.x86_64
---> Package php-cli.x86_64 0:5.3.29-1.8.amzn1 will be installed
---> Package php-common.x86_64 0:5.3.29-1.8.amzn1 will be installed
--> Running transaction check
---> Package apr-util-ldap.x86_64 0:1.4.1-4.17.amzn1 will be installed
---> Package httpd-tools.x86_64 0:2.2.31-1.6.amzn1 will be installed
--> Processing Conflict: httpd24-2.4.16-1.63.amzn1.x86_64 conflicts httpd < 2.4.16
--> Processing Conflict: httpd24-tools-2.4.16-1.63.amzn1.x86_64 conflicts httpd-tools < 2.4.16
--> Processing Conflict: php55-5.5.31-1.111.amzn1.x86_64 conflicts php < 5.5.31-1.111.amzn1
--> Processing Conflict: php55-cli-5.5.31-1.111.amzn1.x86_64 conflicts php-cli < 5.5.31-1.111.amzn1
--> Processing Conflict: php55-common-5.5.31-1.111.amzn1.x86_64 conflicts php-common < 5.5.31-1.111.amzn1
--> Processing Conflict: php56-cli-5.6.17-1.120.amzn1.x86_64 conflicts php-cli < 5.5.22-1.98
--> Processing Conflict: php56-common-5.6.17-1.120.amzn1.x86_64 conflicts php-common < 5.5.22-1.98
--> Finished Dependency Resolution
Error: php55-cli conflicts with php-cli-5.3.29-1.8.amzn1.x86_64
Error: php56-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
Error: httpd24-tools conflicts with httpd-tools-2.2.31-1.6.amzn1.x86_64
Error: php55-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
Error: httpd24 conflicts with httpd-2.2.31-1.6.amzn1.x86_64
Error: php55 conflicts with php-5.3.29-1.8.amzn1.x86_64
Error: php56-cli conflicts with php-cli-5.3.29-1.8.amzn1.x86_64
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

会隐藏网址中的.php。

除了一个链接外,其他链接完全正常。

RewriteEngine on  
RewriteCond %{REQUEST_FILENAME} !-d  
RewriteCond %{REQUEST_FILENAME}\.php -f  
RewriteRule ^(.*)$ $1.php

如果我点击其他链接,则网址将如下所示 http://localhost/newdesign/en/careers并将成功重定向到正确的页面。

但是当我点击产品菜单时,链接就变成了 http://localhost/product

因此,产生错误。我尝试检查所有链接,以确保我输入正确的URL。奇怪的是,这只发生在特定菜单上。

任何帮助将不胜感激。谢谢!

0 个答案:

没有答案