url-rewriting

URL rewriting advice please

China☆狼群 提交于 2020-01-14 06:12:27
问题 I would like to make my urls more seo friendly and for example change this: http://www.chillisource.co.uk/product?&cat=Grocery&q=Daves%20Gourmet&page=1&prod=B0000DID5R&prodName=Daves_Insanity_Sauce to something nice like this: http://www.chillisource.co.uk/product/Daves_Gourmet/Daves_Insanity_Sauce What is the best way of going about doing this? I've had a look at doing this with the htaccess file but this seems very complicated. Thanks in advance 回答1: Ben Paton, there is in fact a very easy

Rewrite Url .htaccess

空扰寡人 提交于 2020-01-14 05:24:06
问题 I have a site with many html page in different directory ,and .htaccess file http://mysite.com/index.html . . . http://mysite.com/design/index.html . . . http://mysite.com/doc/ui/index.html . . . I want to rewrite all of index.html page to : http://mysite.com/doc.php . . . http://mysite.com/design/doc.php . . . http://mysite.com/doc/ui/doc.php . . . I have a single page doc.php & I want to all of my index.html page rewrite to this page and I can get query string url and get page value and

Wildcard in MapPageRoute

回眸只為那壹抹淺笑 提交于 2020-01-14 05:07:05
问题 I have a webforms-project where I use System.Web.Routing.RouteCollection.MapPageRoute to rewrite URLs but I have a problem with a few dynamic URLs. My URL could look like this; /folder/city-1-2-something.aspx and the MapPageRoute for this looks like this routeCollection.MapPageRoute("CompanyCity", "folder/city-{id}-{pid}-{title}.aspx", "~/mypage.aspx"); But I have realized that some URLs could look like this /folder/city-2-2-something-something.aspx /folder/city-2-2-something-something

Wildcard in MapPageRoute

此生再无相见时 提交于 2020-01-14 05:04:27
问题 I have a webforms-project where I use System.Web.Routing.RouteCollection.MapPageRoute to rewrite URLs but I have a problem with a few dynamic URLs. My URL could look like this; /folder/city-1-2-something.aspx and the MapPageRoute for this looks like this routeCollection.MapPageRoute("CompanyCity", "folder/city-{id}-{pid}-{title}.aspx", "~/mypage.aspx"); But I have realized that some URLs could look like this /folder/city-2-2-something-something.aspx /folder/city-2-2-something-something

IIS reverse proxy interfering with redirect location header

爱⌒轻易说出口 提交于 2020-01-14 04:44:22
问题 I have the following rewrite rule on an ASP.Net site to get IIS to act as a reverse proxy: <rewrite> <rules> <rule name="AppReverseProxy" enabled="true" stopProcessing="true"> <match url="([d|u|c]/.*)" /> <action type="Rewrite" url="http://127.0.0.1:12949/{R:1}" /> </rule> </rules> </rewrite> So basically, anything at a path of domain.com/u/* domain.com/d/* or domain.com/c/* will get forwarded to the local server. This works fine, and as a rule I've had no issues until now. I'm having the

retrieve subdomain as a get variable

可紊 提交于 2020-01-14 04:24:08
问题 Hi guys I'm setting up mywebapplication to give unique urls for users such as uniquename.mysite.com, anotheuniqname.mysite.com etc. I want to be able to in a php script grab the subdomain part of the url. Would be nice if I can get it as a GET variable - I think it can be done with htaccess. Any ideas? 回答1: $subdomain = substr($_SERVER['HTTP_HOST'], 0, strpos($_SERVER['HTTP_HOST'], '.')); To make sure there's a valid subdomain: $urlExplode = explode('.', $_SERVER['HTTP_HOST']); if (count(

Rewrite all urls change aspx extension to html

旧巷老猫 提交于 2020-01-14 03:11:26
问题 I'm new in the iis url rewrite module and i not how to do this. for example i have this url: http://localhost/section.aspx?x=section1&IDSection=45 And i want this: http://localhost/section~x~section11~IDSection~45.html Any ideas? Thanks for your help. 回答1: What you need to do is write a handler. That way you can capture the extension and then parse it as needed. This will be invisible to the user. Handler is definitely the way you want to go as if you use URL Routing, you will still need to

Using .htaccess to change directory in url

倾然丶 夕夏残阳落幕 提交于 2020-01-13 18:23:46
问题 I am trying to change the url that is displayed in the address bar from mysite.com/blog/wedding-hair/ to mysite.com/services/wedding-hair/ using .htaccess. Using answers from: https://stackoverflow.com/questions/8713319/assigning-different-name-to-existing-folder-in-url-in-htaccess, rewrite a folder name using .htaccess, and Replace directory name in url with another name I added to the .htaccess file. Here is the .htaccess file, I added the last rewrite rule: Options -Indexes RewriteEngine

Using .htaccess to change directory in url

一笑奈何 提交于 2020-01-13 18:23:16
问题 I am trying to change the url that is displayed in the address bar from mysite.com/blog/wedding-hair/ to mysite.com/services/wedding-hair/ using .htaccess. Using answers from: https://stackoverflow.com/questions/8713319/assigning-different-name-to-existing-folder-in-url-in-htaccess, rewrite a folder name using .htaccess, and Replace directory name in url with another name I added to the .htaccess file. Here is the .htaccess file, I added the last rewrite rule: Options -Indexes RewriteEngine

Is it possible to use mod_rewrite htaccess to rewrite a url from name to id.

你离开我真会死。 提交于 2020-01-13 18:15:06
问题 If I have a URL http://www.domain.com/listing.php?company_id=1 is it possible for me to re-write that to http://www.domain.com/company-name by using that id to pull the name from the database. Or do I have to change listing.php to make it ?company_name=company-name If anyone can point me in the right direction that would be great. Thanks! 回答1: A map function allows using no id in the url at all, while still using the id in the rewritten url to do the database lookup. http://www.domain.com