url-rewriting

.NET Url rewrite the root url

会有一股神秘感。 提交于 2019-12-10 08:48:58
问题 I have the follow rule in IIS7: <rule name="RewriteAll" stopProcessing="true"> <match url="^([^/]+)/?$" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> <add input="{URL}" negate="true" pattern="\.axd$" /> <add input="{URL}" negate="true" pattern="\.png$" /> <add input="{URL}" negate="true" pattern="\.gif$" /> <add input="{URL}" negate="true" pattern="\.jpg$" /> <add input="{URL}"

WWWROOT in MVC5

╄→гoц情女王★ 提交于 2019-12-10 04:35:55
问题 How to achieve same behavior in ASP.NET MVC5 with static files like it works on aspnet-core with app.UseDefaultFiles(); app.UseStaticFiles(); ? I mean serving static files from some folder over root, e.g. /wwwroot/some.html must be opened on mysite.com/some.html , /wwwroot/img/test.jpg on mysite.com/img/test.jpg etc. Update : I have created wwwroot folder and added following rule to web.config : <system.webServer> <rewrite> <rules> <rule name="Rewrite Static" stopProcessing="true"> <match url

IIS url rewrite - css and js incorrectly being rewritten

[亡魂溺海] 提交于 2019-12-10 04:35:46
问题 Having an issue with my urlrewrites - anytime I point to a page that is to be rewritten it fails to display because it is also applying the rule to the css & js files that are referenced within my webpage. To try and remedy this I put in a fully qualified path to the css and js - this renders fine on any page where the rewrite isnt applied yet when i try to access a rewritten page the browser hangs. Has anyone encountered something similar and if so have you a solution? Appreciate any help.

MVC bundles and IIS virtual directories (URL rewrite)

馋奶兔 提交于 2019-12-10 03:12:34
问题 I'm hosting multiple applications on IIS server virtual directories and I'm using URL Rewrite to facilitate them. All images and other assets that are manually written like this "~/path/to/my/content" has a correct output "/path/to/my/content" , but bundle paths like "~/client/js" gives an output "/myapplication/client/js" which should be "/client/js" . How can I fix that? How I initiate Script bundle: var scriptBundle = new ScriptBundle("~/client/js"); Rewrite configuration: <rule name=

angular module.run ReferenceError: $location is not defined

眉间皱痕 提交于 2019-12-10 02:31:20
问题 I want to AngularJS Change Path Without Reloading, look http://joelsaupe.com/programming/angularjs-change-path-without-reloading/ in core.js: 'use strict'; angular.module('App',['ngRoute']) .run(['$route', '$rootScope', '$location', function ($route, $rootScope, $location) { var original = $location.path; $location.path = function (path, reload) { if (reload === false) { var lastRoute = $route.current; var un = $rootScope.$on('$locationChangeSuccess', function () { $route.current = lastRoute;

htaccess rewrite rules with mod_GeoIP

*爱你&永不变心* 提交于 2019-12-10 00:59:03
问题 I'm having some issues with mod_geoip for an ecommerce site that has 3 different stores. We have our main store at root/store, but also have have stores at root/ukstore and root/austore. The main root/store contains a /skin, /media, and /js directories that contain all css, images, and javascripts. With this current setup, the urls flawlessly swap out the base, but leaves the rest of the URL intact so if a user from the UK goes to root/store/category/product/ they get redirected to root

How can I create a dynamic URL in php?

为君一笑 提交于 2019-12-10 00:08:20
问题 I am new in PHP and MySQL. Here's what I've tried so far and I can't understand how to make URL with PHP. What I want to do is to create a dynamic web page about a particular book. I already created and have some data in my MySQL database to play with. I've got a function to clear the special characters in the book titles. function seo($s) { $tr = array('ş','Ş','ı','İ','ğ','Ğ','ü','Ü','ö','Ö','Ç','ç'); $eng = array('s','s','i','i','g','g','u','u','o','o','c','c'); $s = str_replace($tr,$eng,$s

How to remove multiple trailing slashes?

心不动则不痛 提交于 2019-12-09 23:58:50
问题 Here are my rewrite rules: ########### # Rewrite # ########### # Settings RewriteEngine On RewriteBase / # Cache Busting RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} "^(.+)\.\d+\.(css|js)$" [NC] RewriteRule "^.*$" "/%1.%2" [L] # No Index RewriteCond %{THE_REQUEST} "\ /.*index\.php.*\ " [NC] RewriteRule "^(.*)index\..+$" "/$1" [L,NC,R=301] # No Question Mark RewriteCond %{THE_REQUEST} "\ /[^?]*\?\ " RewriteRule "^(.*)$" "/$1?" [L,R=301] #

urlrewriter issue: Query string is duplicated shown?

旧巷老猫 提交于 2019-12-09 23:25:54
问题 I'm using urlRewritingNet. My web.config is here>> <add name="HOME" virtualUrl="^~/(.*)/Default.aspx" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/Default.aspx?PageTitle=$1" ignoreCase="true"/> My query string is here: www.domain.com/home/default.aspx This works. But I'm insert LoginStatus control. When click on the login control to logout, Page url was like this www.domain.com/home/default.aspx?PageTitle=home Request.Querystring["PageTitle"] result is home,home How to

servlet filter to rewrite URL

孤街醉人 提交于 2019-12-09 22:19:09
问题 I am trying to rewrite a URL from: localhost:8080/sendEmail/newEmail.pdf?request_id=23456&emailAddress= To: localhost:8080/sendEmail/newEmail.pdf?request_id=23456 Filter class code and mapping is below. How can I accomplish this task? (An answer with an example would be highly appreciated). Filter mapping: <filter> <filter-name>RequestFilter</filter-name> <filter-class>com.abc.ms.email.filter.RequestFilter</filter-class> </filter> <filter-mapping> <filter-name>RequestFilter</filter-name> <url