url-rewriting

Mod rewrite, need to allow only letters, numbers and white spaces

房东的猫 提交于 2019-12-12 01:48:58
问题 Since I need to allow my users, to search strings with white spaces, I need to modify this rewrite rule (lighttpd engine). "^/(results)/(query)/([0-9a-zA-Z_]+)$" => "index.php?action=results&query=$3", To allow only letters, numbers and white spaces (I guess only those are needed to search some data from MySQL?). Thank you in advance. 回答1: Whitespace in regex is \s "^/(results)/(query)/([0-9a-zA-Z_\s]+)$" => "index.php?action=results&query=$3" or "^/(results)/(query)/([\w\d\s_]+)$" => "index

SEO friendly URL issue

痞子三分冷 提交于 2019-12-12 01:48:32
问题 I have a problem in after creating SEO friendly links in my site. here is the .htaccess file codes. RewriteEngine On RewriteRule ^www/category/([0-9]+)/(.*?).html$ www/product/productlist.php?category=$1 [L] preciously i have this link http ://www.mysite.com/www/product/productlist.php?category=00136 now SEO link is this http ://www.mysite.com/www/category/00136/aprons.html this is working okay. and the issue im having is after the page loads all other site links also changed. and those links

Rewriting subdomain for local environment via htaccess

情到浓时终转凉″ 提交于 2019-12-12 01:43:51
问题 I need to rewrite subdomain for local environment using htaccess. I have enabled virtual host in local and its working. Rewrite <link href="http://cdn.example.com/css.css" rel="stylesheet" type="text/css" /> to <link href="http://cdn.localhost/css.css" rel="stylesheet" type="text/css" /> I am trying this way but its not working Rewritecond %{HTTP_HOST} ^cdn.example.com [NC] Rewriterule ^(.*)$ cdn.localhost/$1 [L,NC,QSA] I just need to rewrite http://cdn.example.com to http://cdn.localhost

How to remap all the request to a specific domain to subdirectory in ASP.NET

梦想与她 提交于 2019-12-12 01:38:35
问题 I am using ASP.NET 4.0 (integrated pipeline) with multiple domains in one hosting account. I have my primary domain set up but I want to separate the domains clearly using folder hiearchy. (I have root FTP access, can map all the domains but the master domain to subfolders) I need to map my master domain to a folder too. I'm sure ASP.NET does provide such functionality, probably in web.config settings, but I don't know how to do it. All my searches have led to PHP/Apache settings but I couldn

rewrite get parameters in .htaccess

强颜欢笑 提交于 2019-12-12 01:37:51
问题 Here is my website : http://www.example.com and i want to rewrite url in .htaccess here is URL : http://www.example.com/sub_portfolio.php?act=sub_cat and i want to .. /sub_portfolio/sub_cat i tried many rewrite condition it not worked and also check many post in our website stack overflow. like url rewrite conditions give suggetion... 回答1: You can easily rewrite your url using the following code. RewriteEngine On RewriteRule ^sub_portfolio/([A-Za-z0-9-]+)/?$ sub_cat.php?act=$1 [NC,L] Make

URL rewrite for converting path to querystring

天大地大妈咪最大 提交于 2019-12-12 01:36:01
问题 I try to make the URL like the following http://domain/d1/d2/k1/val1/k2/val2/k3/val3 To be http://domain/index.php?one=d1&two=d2&k1=val1&k2=val2&k3=val3 Above one and two are fixed keys, the rest of the path is for key-value pairs. When I have more key-value pairs (more than three) attached after /d1/d2/, how do I write out the URL rewrite rules? Update#1: Below is what I have so far. I cannot have a dynamic key value pairs appended at the end of the first two folders. RewriteEngine on

URL Aliasing using .htaccess

天大地大妈咪最大 提交于 2019-12-12 01:35:08
问题 I have a directory 'Domainname1/folder/'. In Domainname1, I have a sub-directory which is a sub-domain (abc.mydomain.com) of another domain. This is a reference to 'domainname1/folder/'. The thing is I want the URL links accessing 'domainname1/folder/' to display the sub-domain definition. So instead of seeing: 'domainname1/folder/' They see: 'abc.mydomain.com/path' How can I do this? 回答1: you should use a reverse proxy to do such setup, here a basic howto. Hope this would help you 回答2: You

mod redirect and rewrites ( Part 2 )

一个人想着一个人 提交于 2019-12-12 01:33:25
问题 Further to my previous questions i am getting my self into a mess, so i will try and lay my problem/s out as best as i can here. I am tidying up my URL structure but have the problem that my urls are well indexed in Search engines, so i need to rewrite my urls while also redirect them. With help earlier on a previous question i currently have the following in my .htaccess Options +FollowSymlinks RewriteEngine on rewritecond %{http_host} ^mydomain.com [nc] rewriterule ^(.*)$ http://www

Rewrite all URLs to a new domain and include an extra parameter

萝らか妹 提交于 2019-12-12 01:28:41
问题 Which .htaccess redirect rule(s) would one use to create all of the following forwards? http://old.io --> http://new.com?pa=va http://old.io/ --> http://new.com/?pa=va http://old.io/abc --> http://new.com/abc?pa=va http://old.io#def --> http://new.com#def?pa=va http://old.io/abc#def --> http://new.com/abc#def?pa=va . . . and include any other arbitrary parameters: http://old.io?p2=v2 --> http://new.com?pa=va&p2=v2 http://old.io/?p2=v2 --> http://new.com/?pa=va&p2=v2 http://old.io/abc?p2=v2 --

G-WAN URL rewrite for home page not working

坚强是说给别人听的谎言 提交于 2019-12-12 01:23:46
问题 I am trying to do a URL rewrite for the site home page. Here is a simplified version of my handler. int init(int argc, char *argv[]) { u32 *states = (u32*)get_env(argv, US_HANDLER_STATES); *states = (1 << HDL_AFTER_READ); return 0; } int main(int argc, char *argv[]) { xbuf_t *read_xbuf = (xbuf_t*)get_env(argv, READ_XBUF); xbuf_replfrto(read_xbuf, read_xbuf->ptr, read_xbuf->ptr + 16, " / ", " /?home "); return 255; } void clean(int argc, char *argv[]) {} Basically it is just replacing " / "