.htaccess文件无法在Apache Server上运行

时间:2022-02-13 10:51:32

I have hosted my site on www.hostmoster.com, I have written .htaccess file for URL rewritting, it was working properly since last 1 year.. but today they have made some upgrade in their Apache Server.. and now my .htaccess file is not working properly. the contents of my file is

我已经在www.hostmoster.com上托管了我的网站,我写了.htaccess文件用于URL重写,它在过去的一年里工作正常..但是今天他们在Apache服务器上进行了一些升级..现在我的.htaccess文件无法正常工作。我的文件的内容是

RewriteEngine on
RewriteRule ^$ /index.php [L]
RewriteCond $1 !^(index\.php|functions\.php|showpopup\.php|signup\.php|chat|tmp|extras|services|flash|data|images|forum|business|css|scripts|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ /index.php/$1 [L]

Please help me out.. Apache Server version is 2.2.11.. The problem i am facing is that for each of page request it opens the index.php page

请帮帮我.. Apache Server版本是2.2.11 ..我面临的问题是,对于每个页面请求,它打开index.php页面

2 个解决方案

#1


Maybe ...

Note:

If you want to call your .htaccess file something else, you can change the name of the file using the AccessFileName directive. For example, if you would rather call the file .config then you can put the following in your server configuration file:

如果要将.htaccess文件调用为其他文件,可以使用AccessFileName指令更改文件名。例如,如果您希望调用文件.config,则可以将以下内容放入服务器配置文件中:

AccessFileName .config

From Apache docs

来自Apache文档

#2


I can be for two reason. One for the permission of the file and second is for the disable to execute .htaccess by web server. Use this link to check apache configuration to execute .htaccess file.

我有两个原因。一个用于文件的许可,第二个用于禁用由Web服务器执行.htaccess。使用此链接检查apache配置以执行.htaccess文件。

http://httpd.apache.org/docs/current/howto/htaccess.html

It is sure in shared server you will not be allow to access of .conf file but you can ask problem to support team, they can help you.

在共享服务器中您肯定不会允许访问.conf文件,但您可以提出问题支持团队,他们可以帮助您。

#1


Maybe ...

Note:

If you want to call your .htaccess file something else, you can change the name of the file using the AccessFileName directive. For example, if you would rather call the file .config then you can put the following in your server configuration file:

如果要将.htaccess文件调用为其他文件,可以使用AccessFileName指令更改文件名。例如,如果您希望调用文件.config,则可以将以下内容放入服务器配置文件中:

AccessFileName .config

From Apache docs

来自Apache文档

#2


I can be for two reason. One for the permission of the file and second is for the disable to execute .htaccess by web server. Use this link to check apache configuration to execute .htaccess file.

我有两个原因。一个用于文件的许可,第二个用于禁用由Web服务器执行.htaccess。使用此链接检查apache配置以执行.htaccess文件。

http://httpd.apache.org/docs/current/howto/htaccess.html

It is sure in shared server you will not be allow to access of .conf file but you can ask problem to support team, they can help you.

在共享服务器中您肯定不会允许访问.conf文件,但您可以提出问题支持团队,他们可以帮助您。