C
Chrisfu
Guest
Hi guys, first time poster here.
Our company has just signed up as a reseller and we're having a slight issue with the Directory/Files directive from within vhost.conf. It's not working as it should when using a method of creating clean URLs via the Apache Files directive.
Our vhost.conf looks like this:
-- vhost.conf start --
<Directory /var/www/vhosts/<site removed from post>/httpdocs/blog>
AllowOverride All <-- added this and below line just to be sure i wasn't missing anything
Options +All +MultiViews
<Files "item">
SetHandler php-script
ForceType application/x-httpd-php
</Files>
<Files "section">
SetHandler php-script
ForceType application/x-httpd-php
</Files>
RewriteEngine On
RewriteBase /
RewriteRule ^.*trackback.*$ - [F,L]
</Directory>
-- vhost.conf end --
Of course after adding this file we executed the following command and reloaded Apache:
/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=<site removed from post>
Basically our main site is at /var/www/vhosts/<site removed from post>/httpdocs and I wanted to add some options for the subdirectory "blog". The rewrites must be working correctly as we've not yet had any trackback spam in the blog comments, which was a constant problem before we added the rewrite.
The "item" file is basically a PHP file that takes the argument and jumps to the correct blog post ID in this fashion:
http://<site removed from post>/blog/item/20
The "section" file works in much the same way, but like this instead, and displays the posts of a section:
http://<site removed from post>/blog/section/food
When visiting any of these URLS, I get a 404 message, and if I visit the file straight (ie. http://<site removed from post>/blog/item) it tries to download it as a PHTML file, meaning it's not parsing the file as PHP at all. I've tried using these exact options in a .htaccess file in /var/www/vhosts/<site removed from post>/httpdocs/blog too, and they still didn't work. Finally, I've tried adding them also to httpd.include temporarily to see if it worked that way, with no success.
This site has been a straight migration from an Ensim installation where it worked fine. I'm guessing there's a config option higher up in /etc/httpd/conf and conf.d that I'm missing that will fix it, but I've not been able to find anything as of yet. On the old site, the vhost.conf options used to work fine within .htaccess in the /blog subdirectory. The current site is on CentOS with the latest version of Plesk.
If anyone has any ideas on how this could be fixed I'd be very grateful to hear any suggestions.
Thanks,
Chris
Our company has just signed up as a reseller and we're having a slight issue with the Directory/Files directive from within vhost.conf. It's not working as it should when using a method of creating clean URLs via the Apache Files directive.
Our vhost.conf looks like this:
-- vhost.conf start --
<Directory /var/www/vhosts/<site removed from post>/httpdocs/blog>
AllowOverride All <-- added this and below line just to be sure i wasn't missing anything
Options +All +MultiViews
<Files "item">
SetHandler php-script
ForceType application/x-httpd-php
</Files>
<Files "section">
SetHandler php-script
ForceType application/x-httpd-php
</Files>
RewriteEngine On
RewriteBase /
RewriteRule ^.*trackback.*$ - [F,L]
</Directory>
-- vhost.conf end --
Of course after adding this file we executed the following command and reloaded Apache:
/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=<site removed from post>
Basically our main site is at /var/www/vhosts/<site removed from post>/httpdocs and I wanted to add some options for the subdirectory "blog". The rewrites must be working correctly as we've not yet had any trackback spam in the blog comments, which was a constant problem before we added the rewrite.
The "item" file is basically a PHP file that takes the argument and jumps to the correct blog post ID in this fashion:
http://<site removed from post>/blog/item/20
The "section" file works in much the same way, but like this instead, and displays the posts of a section:
http://<site removed from post>/blog/section/food
When visiting any of these URLS, I get a 404 message, and if I visit the file straight (ie. http://<site removed from post>/blog/item) it tries to download it as a PHTML file, meaning it's not parsing the file as PHP at all. I've tried using these exact options in a .htaccess file in /var/www/vhosts/<site removed from post>/httpdocs/blog too, and they still didn't work. Finally, I've tried adding them also to httpd.include temporarily to see if it worked that way, with no success.
This site has been a straight migration from an Ensim installation where it worked fine. I'm guessing there's a config option higher up in /etc/httpd/conf and conf.d that I'm missing that will fix it, but I've not been able to find anything as of yet. On the old site, the vhost.conf options used to work fine within .htaccess in the /blog subdirectory. The current site is on CentOS with the latest version of Plesk.
If anyone has any ideas on how this could be fixed I'd be very grateful to hear any suggestions.
Thanks,
Chris