url-rewriting

how to rewrite a url with two variables using .htaccess

删除回忆录丶 提交于 2019-12-03 20:23:54
i want rewrite it with a .htaccess i have this url: ../index.php?page=details&id=123456 like this: ../detail/123456 but I do not really know how to do this. Could you help me to rewrite this url? or give me a simple example that I can understand how it works This should work: RewriteEngine On RewriteRule ^detail/([^/]*)$ /index.php?page=details&id=$1 [L] RewriteRule ^(.*)/([0-9]+)$ index.php?page=$1&id=$2&%{QUERY_STRING} The first (.*) selects any string, e.g. "details". ([0-9]+) catches a number, in your case "123456" Finally &%{QUERY_STRING} ensures, that additional parameters are added to

IIS URL Rewrite

自闭症网瘾萝莉.ら 提交于 2019-12-03 20:18:06
Ok, this is driving me nuts... I'm trying to rewrite my urls like this: Now: http://www.somedomain.com/Somepage.aspx http://www.somedomain.com/AnotherPage.aspx Desired: http://www.somedomain.com/somepage/ http://www.somedomain.com/anotherpage/ Can anyone help me out with this? The terms in the User Interface are damn confusing. Thanks. I found the answer: <rewrite> <rules> <rule name="Redirect" stopProcessing="true"> <match url="^([^\.]+)\.aspx$" /> <conditions> <add input="{REQUEST_METHOD}" negate="true" pattern="^POST$" /> </conditions> <action type="Redirect" url="{ToLower:{R:1}}/"

Creating an admin url for Magento that is admin.magentostore.com (not /admin)

隐身守侯 提交于 2019-12-03 17:06:23
I'm using some load balanced servers and have a requirement wherein all of my admin tasks are relegated to one server. We have determined that the best way to do this is a DNS entry for admin. to point to our primary server. The problem I am seeing is that all of the custom admin urls are all still magentostore.com/admin whereas I need admin.magentostore.com. Any ideas or has anyone done something similar? Thanks! Try it first in development environment for getting rid of live website issues! These can be done by the following steps, : You need to define base url only for admin store view,

Prevent NGINX to remove the port

那年仲夏 提交于 2019-12-03 16:57:40
I want to keep the ServerName and Port dynamicly on my rewrite: Lets say the Firewall redirect port 8081 to 80. So, if i access the webserver for example with "192.168.1.123/frontend" or "my.domain.tld:8081/frontend" i should be redirect to "192.168.1.123/frontend/" or "my.domain.tld:8081/frontend/" If i use the normal redirect rewrite ^(.*[^/])$ $1/ permanent; and i access with the port 8081 the port got removed. (I already tried port_in_redirect off; ) I use almost the default configuration: server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; index index.php

How to write multiple rewrite conditions and rules in one .htaccess file for redirecting urls?

隐身守侯 提交于 2019-12-03 16:28:09
i have sub-site named subsite.site.com (just and example). firstly i want to redirect subsite.site.com to www.subsite.site.com and and finally i want to redirect www.subsite.site.com to www.subsite.site.com/directory/subdirectory/index.html the following rewrite conditions & rules serve this purpose independently. RewriteEngine on RewriteCond %{HTTP_HOST} ^subsite.site\.com RewriteRule ^(.*)$ http://www.subsite.site.com/$1 [R=301,L] RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.subsite\.site\.com$ RewriteRule ^/?$ "http\:\/\/www\.subsite\.site\.com\/directory\/subdirectory\/" [R=301,L how

JQuery: Change URL param without reloading?

早过忘川 提交于 2019-12-03 13:56:28
I have a question, is it possible to change the URL via JQuery under the following conditions: Same URL will load on browser back and on reloads Page doesn't reload when you change the parameter If you wanna prevent the page from reloading you'll have to use hash "#" And if you wanna change the URL try that: jQuery.param.querystring(window.location.href, 'valueA=321&valueB=123'); This will return the following URL: http://bla.com/test.html?valueA=321&valueB=123 I may be wrong but I think the browser will do a post if you change the location. So, could it help you to use a post instead than a

IIS Rewrite Module and sub applications

霸气de小男生 提交于 2019-12-03 13:46:17
问题 Here's what I have deployed: testRedirect is an empty website. All sub-applications are sub-folders that have been converted in application. All of them are ASP .Net MVC sites. Here's what I want to setup: Http://localhost/ must show the content of SiteName1 without displaying Http://localhost/SiteName1/ in the adress bar (it must stay Http://localhost/ ) Http://localhost/SiteName1/ must show the content of SiteName1 without displaying Http://localhost/SiteName1/ in the adress bar (it must

URL Rewrite rule for IIS to replace folder path in everypage

血红的双手。 提交于 2019-12-03 13:38:25
问题 We are having more than 300 pages in my website project. Over the time we have created a new server which is secure. This server is specially used for all the images in website. So here is the scenario: current implementation for images ( in aspx, in css ) http://www.mysite.com/assets/common/image1.jpg sometimes in webpage and css it is specified like this ~/assets/common/image1.jpg would like to use somethig like this. http://www.static.mysite.com/common/image1.jpg and for secure pages https

IIS Url Rewrite Module causes “unable to start debugging on the webserver”

…衆ロ難τιáo~ 提交于 2019-12-03 12:56:21
I have just implemented URL Rewrite Module 2.0 for IIS 7 and it seems to be causing a "unable to start debugging on the webserver" error in Visual Studio 2010. Aside from commenting the node in the web.config, does anyone know if there might be a fix for this for VS2010? Thanks Tuizi See the solution of Kirk Woll here: Unable to start debugging on the web server. Could not start ASP.NET debugging VS 2010, II7, Win 7 x64 Just add this rule at the top of your rules <rule name="Ignore Default.aspx" enabled="true" stopProcessing="true"> <match url="^debugattach\.aspx" /> <conditions

ASP MVC Routing with > 1 parameter

99封情书 提交于 2019-12-03 10:17:44
问题 I have the following route defined routes.MapRoute( "ItemName", "{controller}/{action}/{projectName}/{name}", new { controller = "Home", action = "Index", name = "", projectName = "" } ); This route actually works, so if I type in the browser /Milestone/Edit/Co-Driver/Feature complete It correctly goes to the Milestone controller, the edit action and passes the values. However, if I try and construct the link in the view with a url.action - <%=Url.Action("Edit", "Milestone", new {name=m.name,