Reputation: 19
I purchased yesterday a virtual private server with PHP version 5.3.3 Then i upgraded my php version to 5.4.22 Now the htaccess doesnt functional normally.. It doesn't do anything. What i tried: I did this in my httpd.conf
<Directory />
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
And it didn't work so i tried this in my .htaccess:
<FilesMatch "\.(inc|php|php3|php4|php5|php6|phtml|phps)$">
SetHandler x-httpd-php54
</FilesMatch>
And this doesn't work either.
If i create a page with <?php phpinfo() ?>
and i check the loaded modules i see that mod_rewrite is loaded.
My .htaccess
<FilesMatch "\.(htaccess|htpasswd|ini|log|sh|inc|bak)$">
Order Allow,Deny
Deny from all
</FilesMatch>
RewriteEngine on
RewriteRule ^d/(.*)$ delete.php?img=$1 [L]
RewriteRule ^i/(.*)$ i.php?img=$1 [L]
RewriteRule ^e/(.*)$ editor.php?img=$1 [L]
RewriteRule ^u/$ /u/index.php?img=$1
RewriteRule ^([a-zA-Z0-9]*)$ getimage.php?image=$1
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule \.(gif|jpeg|png|bmp|jpg) http://(ip)/6j5o [NC,L]
ErrorDocument 400 http://(ip)/404.php
ErrorDocument 401 http://(ip)/404.php
ErrorDocument 403 http://(ip)/404.php
ErrorDocument 404 http://(ip)/404.php
ErrorDocument 500 http://(ip)/404.php
Any ideas? (My server is a Centos 6 64bit)
Upvotes: 0
Views: 1172
Reputation: 31644
Your Apache config is at /etc/httpd/conf/httpd.conf
. Make sure this line is not commented out
LoadModule rewrite_module modules/mod_rewrite.so
Now, head over to /etc/httpd/conf.d
and look at the config for your site (I hope you've made your own sitename.conf
in here). You should have something like this (yours will probably differ a fair amount, this is from a server hosting one site)
<VirtualHost *:80>
DocumentRoot /var/www/html/mydir
ServerName my.domain.name
ServerAlias my.domain.name
ErrorLog logs/mydomain
CustomLog logs/mydomain common
<Directory "/var/www/html/mydir">
Allow from all
Options +FollowSymLinks
</Directory>
</VirtualHost>
Make sure you use full path names to your site's root directory.
Upvotes: 1