url-rewriting

URL Encoding being lost before processing - ASP.net

拜拜、爱过 提交于 2019-12-13 01:16:53
问题 I am building a web-store that uses URL encoding extensively. I have a list of Departments & Categories in my database which I use to generate the links. These are, of course, URL encoded before they are sent. Some Typical Links are... /MySite/Store/Countertop+Equipment/Can+Openers.aspx /MySite/Store/Dinnerware.aspx /MySite/Store/Kitchen/Pastry%2f+Decorating.aspx In my HTTPHandler I call app.Request.Path to obtain the current path. The string returned by this call is no longer URL encoded

Removing .aspx from pages using rewriteModule?

廉价感情. 提交于 2019-12-13 01:10:02
问题 I'm using ASP .NET rewriteModule to rewrite http://example.com to http://www.example.com. <section name="rewriteModule" type="RewriteModule.RewriteModuleSectionHandler, RewriteModule"/> Then i have this inside <system.webServer> . <rewrite> <rules> <rule name="Canonical" stopProcessing="true"> <match url=".*"/> <conditions> <add input="{HTTP_HOST}" pattern="^([a-z]+[.]com)$"/> </conditions> <action type="Redirect" url="http://www.{C:0}/{R:0}" redirectType="Permanent"/> </rule> </rules> <

url rewrite using asp.net routers with multiple parameter

为君一笑 提交于 2019-12-13 00:53:56
问题 i am looking for url rewrite options using asp.net routers with multiple parameter. i have parameters of category and location. i need to rewrite url with combination of both category and location or category alone or location alone. how to retrieve the search result based on category,location Example www.sample.com/flats-for-rent-india www.sample.com/flats-for-rent www.sample.com/india 回答1: This is not possible unless you have unambiguous separator pattern that can delimit category and

Form Authentication and URL Rewriting

╄→尐↘猪︶ㄣ 提交于 2019-12-13 00:49:14
问题 I'm trying to apply Custom Forms Authentication to my website to which I already applied Url Rewriting. using this code in Application_Start in global.asax file. routes.MapPageRoute("bill-details", //Route Name "{billno}", //URL with Parameters "~/CallCenter/BillDetails.aspx" //Webforms page to Handle it. ); But when I'm trying rewrite the Loginpage Url, I'm not able to rewrite it. <forms loginUrl="/Login.aspx" name="MyCustomAuthentication" timeout="30"/> The Actual Problem is, when I open a

Rewrite request to a sub directory

我是研究僧i 提交于 2019-12-13 00:48:06
问题 I have a web application in a directory suppose xyz . I am trying to redirect all requests to a sub directory www . My current .htaccess code is: RewriteEngine On RewriteRule (.*) /www/$1 [L] But, when I visit http://example.com/xyz/some_url the request is redirected to http://example.com/www/some_url rather http://example.com/xyz/www/some_url which I want. Update: Sorry, I forgot to mention the directory xyz as in my case is likely to renamed. So, this directory doesn't need to be hard coded

Redirect php page to another php page using 301 .htaccess

白昼怎懂夜的黑 提交于 2019-12-13 00:42:00
问题 I have a dynamic page that I need to redirect to another dynamic page in .htaccess. I have tried different syntax for the redirect but nothing seems to work: RewriteEngine on RewriteRule /index.php?p=page&page_id=store$ http://www.website.com/index.php [R=301] OR RewriteEngine on RewriteCond %{QUERY_STRING} ^p=page&page_id=store$ RewriteRule ^/index.php$ http://www.website.com/index.php? [L,R=301] EDIT: I have an old php page in the shopping cart that I have transferred to the new address. So

.htaccess URL redirection using User Agent

时间秒杀一切 提交于 2019-12-13 00:32:34
问题 I've been trying to find a solution to my situation but none worked. I have the following htaccess file which does the following: It redirects site.com/m/page to site.com/m/#page I redirects site.com/d/page to site.com/m/#page It deletes .php extension and the common_ pattern which I had in front of the pages The code so far: Options +FollowSymlinks -MultiViews RewriteEngine On RewriteBase / RewriteRule ^[dm]/(.+)$ /m/#$1 [R=302,NE,L,NC] ## hide .php extension RewriteCond %{THE_REQUEST} \s/

Zend Framework Error : The requested URL was not found

余生长醉 提交于 2019-12-13 00:29:58
问题 I'm trying to set up my zend framework application on this host but I'm getting a Requested URL not found error: The application isn't at the root level i.e its in a folder like: www.mysite.com/zendapp/public The error says that it can't locate the index.php file even though the url given in the erro message is correct. Is this an htaccess issue? The homepage opens fine - the issue arises when I click on any link. Here is my htaccess file: RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s

ASP.NET redirect non existing pages to homepage in web.config using rewrite rules

我与影子孤独终老i 提交于 2019-12-13 00:16:43
问题 In my ASP.NET SPA application I am using web.config to set Rewrite Rules, so I can refresh pages without error (while using Angularjs), but I also would like to redirect to application's homepage, when non-existing page manually entered into url, please advise how should I modify code below to accommodate this: <rewrite> <rules> <rule name="Products" stopProcessing="true"> <match url="^products" /> <action type="Rewrite" url="/" /> </rule> <rule name="Orders" stopProcessing="true"> <match url

.htaccess redirect to https except admin url

本秂侑毒 提交于 2019-12-12 23:14:38
问题 I would like to redirect all frontend requests to secured site https and all admin / backend urls should remain unsecured http. In addition, I use Cloudflare CDN. My rewrite rules do not work, all queries go to https. RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-Proto} =http RewriteCond %{REQUEST_URI} !admin RewriteRule ^ https://example.com%{REQUEST_URI} [L,R=301] Please help me. 回答1: It should work fine as you have it, although I would change: RewriteCond %{REQUEST_URI} !admin to