isapi-rewrite

SEO friendly URL's with .htaccess

别说谁变了你拦得住时间么 提交于 2019-12-02 05:04:45
问题 Can anybody please help me with some URL rewriting? I have (for example) these pages: www.mydomain.com/test/gallery.asp?id=2 www.mydomain.com/test/gallery.asp?id=3 and want them to be requested as: www.mydomain.com/photos/people www.mydomain.com/photos/wildlife I'm using IIS and at first my hosting provider was using ISAPI_Rewrite with a httpd.ini file, now they have switched to Helicon Ape with a .htaccess file. See: http://www.isapirewrite.com/ and http://www.helicontech.com/ape/ I tried it

SEO friendly URL's with .htaccess

匆匆过客 提交于 2019-12-02 01:25:50
Can anybody please help me with some URL rewriting? I have (for example) these pages: www.mydomain.com/test/gallery.asp?id=2 www.mydomain.com/test/gallery.asp?id=3 and want them to be requested as: www.mydomain.com/photos/people www.mydomain.com/photos/wildlife I'm using IIS and at first my hosting provider was using ISAPI_Rewrite with a httpd.ini file, now they have switched to Helicon Ape with a .htaccess file. See: http://www.isapirewrite.com/ and http://www.helicontech.com/ape/ I tried it the ISAPI_Rewrite way: RewriteRule /photos/people /test/gallery.asp?id=2 [I,L] RewriteRule /photos

Redirecting non-www URL to www using .htaccess

让人想犯罪 __ 提交于 2019-11-30 20:28:37
I'm using Helicon's ISAPI Rewrite 3 , which basically enables .htaccess in IIS. I need to redirect a non-www URL to the www version, i.e. example.com should redirect to www.example.com. I used the following rule from the examples but it affects subdomains: RewriteCond %{HTTPS} (on)? RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC] RewriteCond %{REQUEST_URI} (.+) RewriteRule .? http(?%1s)://www.%2%3 [R=301,L] This works for most part, but is also redirect sub.example.com to www.sub.example.com. How can I rewrite the above rule so that subdomains do not get redirected? Append the following

Why are blank pages being served with “200 OK” for asp.net errors in IIS 8.5 (Win 2012 R2)?

南楼画角 提交于 2019-11-30 11:32:53
I've set up a new Windows 2012 R2 server running IIS 8.5. We noticed that when an error occurs (eg the ASP.NET State Service was not running) that instead of outputting a 500 status code error screen, the request actually returns a totally blank page (only headers - with no content). We obviously need to see the errors and serving 200 OK for an error could be very problematic for indexers like Google etc or any wesite monitoring tools (which would not notify us that the site had gone offline). On our other servers (IIS 7) we see the "yellow error screen" with a message like "could not connect

Redirecting URL without www to www

≯℡__Kan透↙ 提交于 2019-11-30 07:33:08
I need your help. I want to test if the URL is entered without www like example.com it should be forwarded to www.example.com . Try this mod_rewrite rule: RewriteEngine on RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com$ [NC] RewriteRule ^.*$ http://www.example.com/$0 [NC,L,R=301] If you are using nginx , then add this line to nginx config : server { listen 80; server_name yourdomain.com; rewrite ^/(.*) http://www.yourdomain.com/$1 permanent; } 来源: https://stackoverflow.com/questions/2272159

Redirecting non-www URL to www using .htaccess

喜夏-厌秋 提交于 2019-11-30 05:38:53
问题 I'm using Helicon's ISAPI Rewrite 3, which basically enables .htaccess in IIS. I need to redirect a non-www URL to the www version, i.e. example.com should redirect to www.example.com. I used the following rule from the examples but it affects subdomains: RewriteCond %{HTTPS} (on)? RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC] RewriteCond %{REQUEST_URI} (.+) RewriteRule .? http(?%1s)://www.%2%3 [R=301,L] This works for most part, but is also redirect sub.example.com to www.sub.example.com.

URL Rewrite of a subdirectory to a different domain using IIS

喜欢而已 提交于 2019-11-29 11:41:56
GOAL #1: www.web1.com/web2 needs to point to www.web2.com GOAL #2: Users must always see www.web1.com/web2 and the paths & queries in web2 For example: www.web1.com/web2/login OR www.web1.com/web2/?query=string www.web1.com is on IIS6 (using ISAPI Rewrite) www.web2.com is on IIS8 (using URL Rewrite & ARR) Can someone guide me on how I should go about this? ======================= On web1, I used the following: RewriteCond %{HTTP_HOST} ^www.web1.com$ RewriteRule ^/web2/?$ www.web2.com [NC,P,R=301,L] On web2, I setup an ARR server farm and have created an inbound rule. However, when I pull www

Can I do an if/then/else in htaccess?

情到浓时终转凉″ 提交于 2019-11-29 10:36:28
I have a site that serves up certain content based on the subdomain. So it is the same set of files, and maybe the header and some info in the site pages changes based on the subdomain. I need to have different htpassword authentication based on the subdomain as well, but can't find info on how to do an if/then type of thing in htaccess . Basically what I need is this: if subdomain = 'abc' use this htpassword file if subdomain = 'def' use this htpassword file Can this be done? Try something like this: SetEnvIf Host ^abc\. HOST_ABC SetEnvIf Host ^dev\. HOST_DEF <IfDefine HOST_ABC> AuthUserFile

Redirecting URL without www to www

◇◆丶佛笑我妖孽 提交于 2019-11-29 10:08:42
问题 I need your help. I want to test if the URL is entered without www like example.com it should be forwarded to www.example.com . 回答1: Try this mod_rewrite rule: RewriteEngine on RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 回答2: RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com$ [NC] RewriteRule ^.*$ http://www.example.com/$0 [NC,L,R=301] 回答3: If you are using nginx , then add this line to nginx config : server { listen 80; server_name

URL Rewrite of a subdirectory to a different domain using IIS

老子叫甜甜 提交于 2019-11-28 05:21:22
问题 GOAL #1: www.web1.com/web2 needs to point to www.web2.com GOAL #2: Users must always see www.web1.com/web2 and the paths & queries in web2 For example: www.web1.com/web2/login OR www.web1.com/web2/?query=string www.web1.com is on IIS6 (using ISAPI Rewrite) www.web2.com is on IIS8 (using URL Rewrite & ARR) Can someone guide me on how I should go about this? ======================= On web1, I used the following: RewriteCond %{HTTP_HOST} ^www.web1.com$ RewriteRule ^/web2/?$ www.web2.com [NC,P,R