Articles of http status code 404

redirect404错误,而不重写URL

是否有可能有一个错误的url留在地址栏中,同时将用户redirect到我的域中的URL? 我希望www.domain.com/forum是在所有404个情况下服务的实际网站,但我不希望引用url被重写(域名部分除外,这是在注册服务商级别完成的)。 这是我当前的.htaccess RewriteEngine On RedirectMatch permanent ^/$ http://www.domain.com/forum/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* http://www.domain.com/forum/ [L,R]

在Nginx中为虚拟主机使用共享的404页面

我想在我的虚拟主机上使用共享的404页面。 以下是我的设置。 两个站点,每个都有自己的configuration文件在/ sites-available /和/ sites-enabled / www.foo.com bar.foo.com www目录设置为: www/ foo.com/ foo.com/index.html bar.foo.com/ bar.foo.com/index.html shared/ shared/404.html 除了根目录和服务器名称之外,/ sites-available中的两个configuration文件都是相同的: root /var/www/bar.foo.com; index index.html index.htm index.php; server_name bar.foo.com; location / { try_files $uri $uri/ /index.php; } error_page 404 /404.html; location = /404.html { root /var/www/shared; } 我已经尝试了上面的代码,并尝试设置error_page 404 /var/www/shared/404.html (没有以下位置块)。 我也双重检查,以确保我的权限设置为775所有文件夹和www中的文件。 当我尝试访问一个不存在的页面时,Nginx会提供我试图访问的虚拟主机的index.php文件。 任何人都可以指出我做错了什么? 谢谢!

mod_negotiation似乎被启用,但没有扩展名的.php文件返回404

我遇到以下问题 – 移至新平台后,除非URL包含扩展名,否则PHP文件不会被find。 所以,如果/var/www包含文件problem.php ,URL http://localhost/problem.php显示正确,但是http://localhost/problem没有。 我已经尝试了以下内容: 检查configuration文件中是否启用了MultiViews : <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> 检查是否通过phpinfo()加载mod_negotiation : 加载模块:core mod_log_config mod_logio mod_version prefork http_core mod_so mod_alias mod_auth_basic mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_deflate mod_dir mod_env mod_mime mod_negotiation mod_php5 mod_reqtimeout mod_rewrite mod_setenvif mod_status 以防万一以上是由压力引起的幻觉,尝试加载mod_negotiation2并重新启动服务器: leviathan www # […]

nginx别名使用php5-fpm响应404

我使用nginx使用php5 fpm。 但我有一个问题。 # debug alias location /bb/ { alias /usr/share/blahblah/; } 找不到http://mysite.localhost/bb/index.php文件。 但仍然在/usr/share/blahblah/index.php 这是一个错误: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream

虚拟主机404错误

机器:Mac Book Pro Web服务器:Apache 我在本地构build一个Wordpress网站,并将其设置为虚拟主机,我对http-vhosts.conf进行了以下更改: <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "/Users/username/Documents/Websites/projectname/index.php" ServerName projectname.dev ErrorLog "/private/var/log/apache2/projectname.dev-error_log" CustomLog "/private/var/log/apache2/projectname.dev-access_log" common </VirtualHost> 我已经在/ etc / hosts文件中创build了一个条目,如下所示: 127.0.0.1 localhost projectname.dev 我也改变了wp_options表中的siteurl和home选项,是http://projectname.dev 但是当我通过浏览器( http://projectname.dev )访问网站时,我只是得到纯文本,没有拾取主题/图像/样式表。 看access_log,我可以看到很多404错误。 任何帮助表示赞赏,我已经玩了一段时间了。 Rgards,Stephen

Apache使用404内存

我们正在面对一个服务于静态文件的apache服务器的问题。 当有大量不存在的资源请求时,apache将开始增加进程和内存使用量,直到它使用所有可用内存并停止应答请求。 这台机器有2GB的内存,它的默认configuration是apache。 有这个问题的解决方法? 任何configuration,这可能是错误的? 非常感谢!

Openshift PHP应用程序抛出“404页未find错误”与自定义域名

我在Openshift上有一个PHP应用程序,可以正常使用本地URL(例如xyz-xy.rhcloud.com )。 后来我给应用程序添加了一个别名(例如, www.xyz.com ),我也在godaddy.com的Zone文件中更新了CName。 当我进入www.xyz.com时,它会将我redirect到www.xyz.com/app并引发404 NOT FOUND错误。 任何人都可以请帮忙?

为什么我要求“/ usr / share / nginx / www404”?

我有要求 /usr/share/nginx/www404 在我的NGINX日志中。 请注意,www和404被混合在一起。 在我的nginx.conf相应的行是 error_page 404 /404.html; 当然,我的网站根目录下有一个404.html。 在这里清理configuration文件(btw为什么这里很难把代码放在一个问题?): nginx.conf在这里: https : nginx.conf wordpress (在网站可用)在这里: https : //gist.github.com/panique/9003446 我的问题:为什么有这个奇怪的“位置”的请求,以及我的404错误configuration有什么问题?

永久链接和nginx不能获得WordPress页面的404s

我有nginx 1.6.2服务一个wordpress网站,用php-fpm。 固定链接设置如下: /blog/%postname%/ nginx正确地为网站页面( / , /products , /contact …)以及博客文章(在/blog/ )提供服务。 404s可以很好地用于博客文章(即example.com/blog/idontExist将以404响应)。 但是,浏览到example.com/iDontExist会得到HTTP 200响应和网站索引页的内容,而不是404。 这是我的nginx.conf: server { server_name example.com; root /var/local/example.com/; access_log /var/log/nginx/example.com-access.log main; error_log /var/log/nginx/example.com-error.log; error_page 404 /index.php?$request_uri; location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; # fastcgi_split_path_info ^(/blog)(/.*)$; include /etc/nginx/fastcgi_params; #fastcgi_intercept_errors on; #fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index […]

WordPress的网站现在显示404错误? 无法修复

我的网站:www.kmskinboutique.com 它现在在页面上显示了一个404错误警告(在主页和选项卡上)。 没有什么是错过的 – 警告只是把我的网站推下去。 我已经search了,不知道如何修复。 任何帮助吗? 我最近更新了所有的插件,所以我不确定哪一个可能导致了这个问题(如果他们真的这样做的话)! 提前致谢! 〜ķ