url-rewriting

Friendly URLs with .htacces NOT working… and stackoverflow URLs style

荒凉一梦 提交于 2019-12-08 09:56:39
问题 I know this question has been asked a million of times here at stackoverflow, but I cant get it to work so I need someone who knows to finally resolve this problem! I want that when this is inserted in the URL: http://website.com/pelicula/0221889/ http://website.com/pelicula/0221889/posters/ It really goes to this: http://website.com/index.php?ctrl=pelicula&id=0160399 http://website.com/index.php?ctrl=pelicula&id=0160399&tab=posters This is how my .htacces file looks like: <IfModule mod

How to manage sub-domains on WinHost with IIS7 URL Rewrite 2.0?

对着背影说爱祢 提交于 2019-12-08 09:08:43
问题 I'm trying out WinHost and I'm running into some issues with sub-domains. On WinHost, you can have multiple sub-domains per hosting account, but each sub-domain points to the root website. E.g. you can have www.example.com, sub1.example.com, and sub2.example.com but all of them display the content at http://www.example.com/. Other Hosts allow you to point sub-domains to a sub folder in your website. This would allow you to point sub1.example.com to /sub1, sub2.example.com to /sub2 and www

Nginx hashtag rewrite rule

南笙酒味 提交于 2019-12-08 08:56:31
问题 How can I create this rewrite rule using regex in nginx: http://www.example.com/my-path-here#hashvalue to http://www.example.com/my-path-here/#hashvalue ? 回答1: Hash tags are a browser only concept and never sent to the server. So you can't rewrite then in nginx. Because when you visit http://www.example.com/my-path-here#hashvalue the nginx server will only be sent http://www.example.com/my-path-here What you need is Javascript to handle such thing for you. Below is a sample html page which

URL Rewrite - Redirect to different port and changing URL using map

☆樱花仙子☆ 提交于 2019-12-08 08:52:18
问题 I want to rewrite URL to redirect to different port, based on HTTP_URL while preserving rest of URL and query string (if specified). For example, http://host/john/page.aspx should be redirected to http://host:1900/page.aspx, http://host/paul/anotherpage.aspx?query to http://host:1901/anotherpage.aspx?query and http://host/ringo to http://host:1902/ I've added bunch of rules for every allowed port, but it does not look efficient or manageable. I'm trying to employ map, (ie john->1900, paul-

dynamic URL rewriting .htaccess

房东的猫 提交于 2019-12-08 08:04:19
问题 I'm new to URlRewriting and I've been having some problems rewriting my URLs, I have one single .php index page in which the content is filled using php depending on the url variables. My problem is that I cannot seem to find the correct expressions to get it working. For my homepage I'm only sending out 1 variable like "index.php?page=home" BUT for other pages I'm using up to 4 variables like "index.php?page=about&content=about-news&id=27&pn=1" Now I got as far as getting 1 or 2 working

Can I do a URL Rewrite to a different Tomcat instance?

允我心安 提交于 2019-12-08 07:58:02
问题 Is is possible to use Tuckey's URL Rewrite to rewrite to a different Tomcat instance? I have it working using crossContext="true" rewriting to a different servlet on the same tomcat instance, but our production server has multiple tomcat instances running and I want to rewrite to one of them instead? If it's not possible using the URL Rewrite filter, is there another way of doing it? Thanks. 回答1: You can't simply rewrite to another instance. You'd either have to fetch the content from another

Handle query parameters recursively using htaccess

白昼怎懂夜的黑 提交于 2019-12-08 07:50:39
问题 I am here again with the query of re-writing URL :(. I am using htaccess for re-writing, below is my htaccess code: RewriteEngine On RewriteBase / RewriteCond %{ENV:REDIRECT_STATUS} 200 RewriteRule ^ - [L] RewriteCond %{REQUEST_URI} !-f RewriteCond %{REQUEST_URI} !\.\w+$ RewriteCond %{REQUEST_URI} !/$ RewriteRule (.*) /$1/ [R,L] RewriteCond %{REQUEST_URI} ^/([\w\d-]+)/$ [NC] RewriteRule ^ /?file_name=%1 [L,QSA] RewriteCond %{QUERY_STRING} !^$ RewriteCond %{QUERY_STRING} (?:(.*)&)?file_name=([

.htaccess RewiteCond (QUERY_STRING) with 2 variable and rewrite properly

邮差的信 提交于 2019-12-08 07:45:25
问题 I need to rewrite my url from: http://***.com/index.php?cat=VAR&page=1 to: http://***.com/VAR/1 With 301 redirection. I got this so far: RewriteCond %{THE_REQUEST} ^(GET|POST)\ /index.php\? RewriteCond %{QUERY_STRING} ^cat=(.*)\&page=(.*) RewriteRule . /%1/%2 [R=301] RewriteEngine On RewriteCond %{REQUEST_URI} !^/(files|admin)/ RewriteRule ^(.*)/(.*)$ /index.php?cat=$1&page=$2 [L] But the first 3 rules doesn't seems to work at all. (I'm a beginner in htaccess) How can i fix this problem?

Regex to match a URL pattern for a htaccess file

南楼画角 提交于 2019-12-08 07:14:54
问题 I'm really struggling with this regex. We're launching a new version of our "groups" feature, but need to support all the old groups at the same URL. Luckily, these two features have different url patterns, so this should be easy? Right? Old: domain.com/group/$groupname New: domain.com/group/$groupid/$groupname The current regex I was using in the regex to redirect old groups to the old script was: RewriteRule ^(group/([^0-9/].*))$ /old_group.php/$1 [L,QSA] It was working great until a group

Using custom rewrite rules in Wordpress

血红的双手。 提交于 2019-12-08 06:43:08
问题 I am trying to create custom rewrite rules in WordPress so that I can pass data to a page based on what is in the query string. My page works fine: /retailers-a-z/?merchant=some_merchant and then also /retailers-a-z/?merchant=some-merchant&offer=some-offer I first tried to create a rewrite rule for this in .htaccess but since realised WordPress has it's own internal redirection database.. so after a lot of research I managed to come up with the following code... However, it is still not