4
hello shine
Please test the following on a testdomain or a test directory to ensure everything is working as intended.
before playing with .htaccess files please ensure that mod_rewrite is enabled on your server and on your Web.
In my case i had to edit config file of that web but that's jut me??
Options +FollowSymLinks +SymLinksIfOwnerMatch
AllowOverride All
When your web is allowed to use mod_rewrite open an editor and type:
ErrorDocument 404 errordocument.html
RewriteEngine on
RewriteCond %{HTTP_HOST} !^domain.com$
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
and save file as ".htaccess"
do not forget to replace domain.com with your domain.tld and replace name of errordocument.html to your needs.
- upload .htaccess to your root of domain
- upload an errordocument to your root of domain (in this case errordocument.html)
in case of xoopsfactory i placed an errordocument within a contentmodul and I put in my .htaccess the following line to redirect 404
ErrorDocument 404 http://xoopsfactory.com/modules/information/xoops-factory-error-document-404.php
cheers
michael
edit:
if there are problems after uploading, you should delete that .htacces file from ftp and check again. Remember that some ftp clients do not show hidden files like .htacces. check for an option to make them visible!