now i saw a very good php script and i rewrite it to asp
the script here:Fantastic Animation PHP/CSS/jQuery Error pages
but know iam in big problem
how i can use .htaccess in asp
see how it work
ErrorDocument 500 /error.php?code=500
can i use .htaccess in asp
please tell me because iam newbie in it
because know i convery error.php to error.asp
.htaccess is a web server thing (primarily Apache), not a PHP or ASP thing. If you have your system set up that Apache serves ASP pages (passing through to IIS or using another ASP interpreter), sure, you can use .htaccess with it. But if you're using IIS directly, IIS has its own mechanism for doing things like mapping error pages and such.
Related
This is a shared hosting environment running on Windows Server 2003. I want to integrate url rewriting,so below translates:
example.com/product-name-color-ID ===> example.com/product?id=ID
Custom 404 page technique seems easiest way for me but how can i do that?
Instead of a custom 404 hack, check out Helicon Ape. It lets you use an .htaccess file (like Apache) for URL rewriting.
I am very new to URL re-writting and I am using Plesk which is Windows based web server and hence I cant use Apache's mod_Rewrite.. can anyone tell me steps for this to happen?
Try ISAPI Rewrite for IIS. It supports mod_rewrite rules of Apache and it is supported by Plesk.
Maybe too late for OP but it might be useful for anyone coming across this. If URL Rewrite is installed in IIS then you can follow this guide to translate htaccess into web.config.
It worked with my case, running PHP website in a shared hosting with Plesk and IIS under ISAPI
I'm using ISAPI Rewrite 3 and my server is running IIS 6. I've never used ISAPI Rewrite before, so I'm a bit in the dark about how to use it.
I'm trying to do a simple redirect, so that if anyone hits
http://www.mysite.com/page.aspx
on my server, they are redirected to
http://externalsite.com/dir/file.htm
which is an external site that isn't mine. Is there a way to do this, or a tutorial that will show me how? I can't find anything on it.
There are numerous tutorials on this module. You can use these links for the beginning:
Exploding myths about mod_rewrite. Part I
Exploding myths about mod_rewrite. Part 2.
Helicon Ape - mod_rewrite documentation
ISAPI_Rewrite examples
Besides ISAPI_Rewrite, Helicon Ape and mod_rewrite are different products rewrite syntax is the same, so you can use documentation for either product.
For the redirect you are asking I guess it should be the following rule in the www.mysite.com .htaccess file:
RewriteEngine on
RewriteRule ^page.aspx http://externalsite.com/dir/file.htm [NC, R]
I am working on one website which is developed in .net. I have uploaded .htaccess files but its nt working.
Is there any new idea for that? I want that my site will be crawled with www.
Thanks
.htaccess is not just for PHP.
It's a configuration file that's read by the Apache HTTP server. So if your application is not running on that server, then that file will not have any effect.
.htaccess and PHP are orthogonal. One is a configuration file for Apache; the other is a scripting language. More than likely, you're using Microsoft's IIS server, not Apache.
The .htaccess file is a configuration file for the Apache web server, and is not dependant on PHP. It typically contains settings relating to web site user permissions, friendly URL definitions, etc.
It can, however contain configuration settings for PHP, if you have settings which are in the server's PHP.ini file that you want to override for this specific web directory.
There are many reasons why a .htaccess file may not work -- it can be broken by some very subtle things, and a faulty .htaccess file will normally cause the whole site to stop working completely, regardless of what the error is.
In this case, the browser will usually simply show an error 500, without much useful information to help you debug it. But there will be more helpful debugging data in the server error log.
If you still struggle with it, you should post your .htaccess file here so we can help you debug it.
However, as #Tomalk says, if you're developing a .NET site then you're probably not using an Apache web server; you're probably using an IIS server. In that case, there are entirely different ways of setting the configuration for the server, and it won't know what to do with .htaccess file.
We recently upgraded from IIS 5.0 and windows 2000 to IIS 7 and windows 2008. For handling url rewrites, we use Helicon Isapi Rewrite 3.
With the new configuration, our rewrite rules are failing because IIS is appending a :80 to our links.
For instance, on the old site.
/media/hr/pdf/application.pdf would redirect to our static server just fine.
On the new site, /media/hr/pdf/application.pdf generates a 404 saying that
:80/media/hr/pdf/application.pdf could not be found.
here is the rule.
RewriteRule (^|^/)(media/.*) http://static.mysite.com/global/images/$2 [NC,L,O]
Does anyone know a way to stop the :80 from being added?
thanks in advance.
I don't know, but....
you can use the built-in IIS7 rewriting module from Microsoft. It's free. It's more commonly used that Helicon's. There's a capability for slurping in rules that are compatible with Apache mod_rewrite, which I think is the same as the syntax for Helicon. Consider it. Find it at http://iis.net
Also - there's a free, open source rewriter that works with IIS7, called IIRF. It won't add :80 to your URLs. Find it at http://iirf.codeplex.com