Hello everybody, Im advertising site in ad network and when ad is clicked from that site, it opens new window where supposed my site to appear, but it shows in address bar something like www.mysite.com/?adclickid=266sda4fs6ad4f and in a window shows "404 Page Not Found The page you requested was not found." Please, if you can, answer those questions, you would help me a lot. 1. Is there any way i can adjust in htacessor somewhere else in my host that it show homepage at least on error pages. 2. Is this problem in my host set up or it is ad network problem? Thanks a lot!
In reverse order: 2. i guess you just missed setting up your configuration at the ads provider. If you see "www.mysite.com" at your browser bar and that isnt your site then you should consider chaging this "default value" to the address of your site. 1. at .htaccess simply set up an Errordocument ErrorDocument 404 /shownonerror.html this would also work with "/anyscript.php" or just the site root "/" or the index "/index.html" Examples: ErrorDocument 404 /anyscript.php ErrorDocument 404 / ErrorDocument 404 /index.html
Thank you very much for fast response, Flaxdex, Im nearly green on programing, i've tried to add those commands to .htacccess, but nothing happens. I start to be suspicious on my htaccess file which i needed to setup in order wscript to work correctly. Here is what i have on my .htaccess: Options +FollowSymLinks RewriteEngine On # leave just a normal / (slash) if the script is installed at root level otherwise enter it's folder here ex: /wscript (! no trailing slash) RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(index\.php|install|scripts|fonts|uploads|robots\.txt|sitemap\.xml|favicon\.ico) # if wscript is installed in a subfolder, add it before index.php ex: RewriteRule ^(.*)$ /wscript/index.php?/$1 [L] otherwise leave it as is RewriteRule ^(.*)$ /index.php?/$1 [L] Code (markup): Wscript (wallpaperscript.net) has a lot of weird things i noticed (though it also very nice looking script at the same time). I would refer to their support too, but sadly, seems nowadays they have no support at all
Update: As a test i deleted all this codes from .htaccess and added only ErrorDocument 404 / And it works, but when that code (posted in previous my post) is on .thaccess file, it doesn't work. Is it possible somehow to make it work together with all this texts? Thank you very much!
Thanks for your help Roopajyothi, Just tried your suggested code, unfortunately it is the same error page
Stinker, you are about to route nearly everything to the script "index.php", thats what the "RewriteCond" and "RewriteRule" statements do. This is quite typical for a CMS. The script "index.php" does not know how to handle the request correctly and if the "ErrorDocument" statement points to the same script it will not work also. The question is, what do you want to do with that "addclickid"? Do you need it? Or can we trash it? In case you do not need that id you can simply add the following right after the "RewriteEngine On" statement and everything should be fine except the loss of that id. RewriteCond %{QUERY_STRING} ^adclickid=([\d\w]+)$ RewriteRule ^.*$ /index.php [R=301,L] Code (markup): And everything with that "adclickid=blabla" will be rerouted without that id. Regards flex