• The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

.htaccess 404 request_uri

C

concertFreak

Guest
need help with request_uri not being returned properly

I'm trying to migrate a site to a new linux box using Plesk 8.1.

The way I have the site I was using a .htaccess file to do 404 redirects to

ErrorDocument 404 /404.cfm

I then used the request_uri variable to grab the uri of the called page before it handed off to the 404 page. Like "/blog/name-of-article.html"

This worked great on the other boxes it has been developed on. On the Plesk set up, the request_uri returns "/404.cfm" instead of the actual url called.

I'm not 100% sure if this is a Plesk configuration issue or if it is something I need to change in the Apache settings or a change to the .htaccess file.
 
Globally it should be done in Apache configuration file. If you set this for specific domain then you need to configure vhost.conf file for this domain.
You can include domain-specific Apache configuration directives into web server configuration file. In Plesk each domain has virtual hosts configuration stored in a separate file httpd.include.

On all Linux systems, this file is located in the directory /var/www/vhosts/<domain-name>/conf/.

On FreeBSD systems, this file is located in the directory /usr/local/psa/home/vhosts/<domain-name>/conf/.

This file is overwritten each time the virtual host configuration is changed, thus any manual alterations made to the file are discarded. To use custom directives or redefine those inserted by Plesk, you need to create the files vhost.conf and/or vhost_ssl.conf with necessary directives in the directory /path_to_vhosts/<domain-name>/conf/ for a domain, and /path_to_vhosts/<domain-name>/subdomains/<subdomain-name>/conf/ for a subdomain.

If any of these files exist by the time the main configuration file is generated, Plesk inserts the appropriate Include directive into the HTTP and/or HTTPS virtual host context respectively. For security reasons, only root can create the vhost.conf and vhost_ssl.conf files.

For the changes to take effect, you need to run the following command:

/plesk_installation_directory/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=<domain_name>
 
I'm not sure that is what I am looking to do. I wasn't looking for somewhere to change the 404 page, since I did that in the .htaccess file.

What I was looking to figure out what was going on was with the request_uri env param not returning the correct value.

I have the 404 page set to
/404page.cfm

When I go to the url
/blog/name-of-article.html

My custom mod-rewrite script would look at the request_uri param and see it is set to
/blog/name-of-article.html

And then know what to do with the url to display the right page. For some reason the request_uri param is returning
/404page.cfm instead.

it is frustrating, since I haven't seen request_uri work like this on any box I've dealt with before.

I've looked through a bunch of docs that I have found online, the httpd.conf file, some of the SetEnvIf things, and nothing seems to fix it.

Sean
 
I figured out what it was. In ColdFusion 7 Adobe changed how the request_uri param worked by getting rid of that var and creating 2 new ones.

cgi.redirect_url
cgi.redirect_query_string

The first for the script part of the uri, and the second for any query params that were in the request_uri.
 
Back
Top