php - htaccess different path for errordocument on localhost -



php - htaccess different path for errordocument on localhost -

i facing problem while editing .htaccess file custom error page.

while on live server, works fine.

errordocument 400 /error.php?e=400 errordocument 401 /error.php?e=401 errordocument 403 /error.php?e=403 errordocument 404 /error.php?e=404 errordocument 500 /error.php?e=500

but on localhost (wamp) site located in folder named sms under www directory. i've modify code

errordocument 400 /sms/error.php?e=400 errordocument 401 /sms/error.php?e=401 ....and on files

is there simple way handle situation dont have edit these line every time... thanks..

it may little bit late in day, had similar problem , solved it.

it's documentroot setting (in apache configuration) culprit. has point folder site resides both on local , remote machines. apparently in case not.

you kind of error if (for example) site resided in sms directory both on local , remote machines, , in both cases directory resided in default document root directory. caused error default root directory gets overriden on server, when configuring virtual hosts.

it this:

<virtualhost *:80> servername yourdomain.com documentroot /var/www/html/sms </virtualhost>

in case default document root has been changed default /var/www/html /var/www/html/sms while on local machine documentroot still set default value (whatever in wamp).

as solution create virtual host custom document root (that point sms directory) on local machine. can done editing httpd-vhosts.conf file (in case should edit hosts file on machine). if have 1 site though, simpler alter default documentroot setting in httpd.conf points sms directory.

php .htaccess errordocument

Comments

Popular posts from this blog

javascript - mongodb won't find my schema method in nested container -

Hibernate criteria by a list of natural ids -

ios - Lagging ScrollView with UIWebview inside -