Questions tagged [rewrite]

URL Rewriting maps an incoming URL to a modified URL, so that the request is processes as if the original request was made to the modified URL. This is often used to provide more search engine friendly URLs.

Filter by
Sorted by
Tagged with
0 votes
1 answer
5k views

IIS Rewrite rule to redirect and remove query string

I'm trying to rewrite in IIS 7.5 from an old website to the new one. We have a list of URL's with and without query strings. I can get the URL's without query strings to redirect but not with. <...
Ian Houghton's user avatar
3 votes
1 answer
255 views

Url rewriting stops working after changing default port on iis7

I have migrated the IIS6 webserver 2003 websites to IIS7 webserver 2008 using msdeploy tool. Application pool setting are changed with "Enable 32-bit Applications=true", "Managed_Pipeline_Mode=Classic"...
Cloudmeteor's user avatar
0 votes
1 answer
58 views

apache rewrite debian vs windows

I have simple rewrite rules as I just learned about them RewriteEngine On RewriteRule ^dl/(.*)/.*$ dl/$1/index.php [L] RewriteRule ^index.php$ upload.js [L] both are working on Windows for url ...
cikatomo's user avatar
  • 149
1 vote
1 answer
830 views

Nginx - Serving static content from deep directory strucutre

I have to store quite a lot of images (lets say 1M) for serving from Nginx, so to avoid having too many files in one folder I'm planning to break them out into folders with names related to the file ...
UpTheCreek's user avatar
  • 1,638
2 votes
0 answers
828 views

nginx proxy_pass to different backends based on location / passing rewrited url

What the quickest and cleanest solution if you want to proxy URL request to two different backends via proxypass based on location. location /app1/ { alias /var/www/ruby/public; ...
lowk3y's user avatar
  • 39
2 votes
1 answer
190 views

Protecting Directory with .htaccess

Unfortunately with a product I rolled out, blackhatters found they could access an unprotected directory where I had the zip files. I use PHP to serve up those zips with readfile(), so normally in my ...
ServerChecker's user avatar
0 votes
1 answer
2k views

Capture part of the URI and use it to do conditional rewrites in Nginx

I am writing a location block for a Nginx config, and it is for URIs with pattern like this: www.mysite.com/a/b/blah/c or www.mysite.com/a/b/blah/c/n. Where a and b are fixed, blah may vary, c can be ...
MLister's user avatar
  • 211
6 votes
2 answers
7k views

It it possible to have multiple ReWrite rules that all do the same Action, for an IIS7.5 webserver?

I've got rewrite module working great for my IIS7.5 site. Now, I wish to add a number of URLs that all go to an HTTP 410-Gone status. Eg. <rule name="Old Site = image1" patternSyntax="ExactMatch"...
Pure.Krome's user avatar
  • 6,608
0 votes
1 answer
929 views

Simple NGinx rewrite is redirecting

I'm trying to setup a friendly URL for a website running on my Nginx server but for some reason, the url's are being redirected instead of being rewritten. For instance If a user visits mydomain.com/...
awarburton's user avatar
0 votes
3 answers
3k views

how to strip string from url using rewrite rule [duplicate]

Possible Duplicate: Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask? sometimes my drupal site add extra string to image url which causes the image to be broken. ...
Alaa Alomari's user avatar
0 votes
1 answer
969 views

existing file gives 404 due to a RewriteCond rule in .htaccess

To redirect a specific domain name to a folder in my public dir, www/, I edited .htaccess to the following: RewriteEngine On RewriteCond %{HTTP_HOST} ^(.+)?domain.com$ RewriteRule ^(/)?$ domain.com/$...
gosuto's user avatar
  • 111
1 vote
2 answers
2k views

Nginx rewrite rule with proxy pass

I'm trying to implement nginx rewrite rules for the following situation Request: http://192.168.64.76/Shep.ElicenseWeb/Public/OutputDocuments.ashx?uinz=12009718&iinbin=860610350635 Should be ...
Eazy's user avatar
  • 190
0 votes
1 answer
84 views

.htaccess Not Working as Expected

I have a hosted account not linked to any domain at /~me. In the top level of my home directory I have a .htaccess file: Options +FollowSymlinks RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.(.+)...
user1561108's user avatar
2 votes
1 answer
1k views

Setting expires header to multiple location block in nginx

In my nginx config, I have serveral location blocks, e.g. location ~* /a { ..} location ~* /b { ..} location ~* /c { ..} And I want to apply the expires header to all of above blocks, e.g. location ...
Howard's user avatar
  • 2,175
1 vote
1 answer
2k views

nginx: rewrite a non-existent php-file to another php-file with all arguments

i really need help here. Sitting for some time now and dont figured it out. I want to realize a very simple task - rewrite a non-existent php file to another existant php file with all arguments like:...
carrot's user avatar
  • 97
0 votes
1 answer
243 views

Rewrite new url and block old url in nginx

I have a local folder /bar, and I want to be able access via http://www.example.com/foo. So I have the config like rewrite ^/foo/(.*)$ /bar/$1 last; At the same time, I want to block public access ...
Howard's user avatar
  • 2,175
0 votes
2 answers
474 views

nginx url rewrites for php-urls

i have to permament redirect some old urls in nginx. the old urls are old-style php urls including a parameter for loading content. they look like this: http://www.foo.com/index.php?site=foo http://...
trnc's user avatar
  • 698
0 votes
2 answers
331 views

iis 7 url rewrite for search results

I have rewrites working for specific directories, but can't figure out how to get the search results rewrite to work. If go directly to /blog/?s=coffee, it goes to the correct search results page. ...
kristina childs's user avatar
0 votes
2 answers
7k views

nginx and try_files: try named location with rewrites before fallback

I'm attempting a website cut-over. We want to preserve our external links by using 301 redirects. I have a lengthy list of redirects in a named location that resembles: location @redirects { ...
Bretticus's user avatar
  • 175
2 votes
2 answers
36k views

nginx: Disallow Access to a Folder, except some subfolders

How it is possible to deny access to a folder, but except some subfolders in it from "deny"? I tried something like this (in this order): #this subfolder shouldn't be denied and php scripts inside ...
carrot's user avatar
  • 97
2 votes
1 answer
494 views

Nginx redirect a particular page from https to http

How can I redirect a specific https page to http, example: https://example.com/foo -> http://example.com/foo Only for the page foo, and no other page. Thank you.
rnathani's user avatar
17 votes
2 answers
18k views

Prevent URL Rewrite rules from being inherited by subdirectories in IIS7

I have a URL Rewrite setup for clean URLs in a CMS and my web.config looks like this: <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <...
Rich Jenks's user avatar
0 votes
1 answer
2k views

Plus sign ( + ) in a rewrite rule (.HTACCESS on Linux Server)

i've this snippet, but it doesn't works. Obviously is that plus sign + tha must be escape ? RewriteCond %{QUERY_STRING} ^orderby=position&controller=search&orderway=desc&search_query=t+...
CalfCrusher's user avatar
0 votes
1 answer
44 views

apache2 adding named virtual host over existing mod

I have a dav_svn.conf look like this. # mod-available/dav_svn.conf <Location /svn> DAV svn SVNParentPath /path/to/svn/parent ... </Location> With this configuration every ...
Jin Kwon's user avatar
  • 135
1 vote
1 answer
1k views

Nginx rewrite rule for Zimbra

I'm trying to write a rewrite rule for Zimbra, which will allow me to use a hostname to access the Zimbra Desktop Web UI instead of the IP address and port. The default Zimbra URLs are like this: ...
Yusuf's user avatar
  • 205
1 vote
2 answers
510 views

Nginx rewrite rule for subdomain

I have a sub-domain, something.site.com. In my main-site, site.com/something, I would like to rewrite to something.site.com, but keep the url site.com/something intact. Is that something I can do ...
Silfverstrom's user avatar
0 votes
1 answer
455 views

Configure VirtualHost to Rewrite HTTP://subdomain... to HTTPS://internaldirectory

How do I configure Apache to rewrite an http request for a subdomain to an https request for the correct directory? For example, I have the following VirtualHost configuration: However, this turns ...
David Kaczynski's user avatar
0 votes
1 answer
2k views

Redirect non-existent subdomain to base domain url

I was using Droplr with my domain, 'example.com', prepended with 'u.'. (u.example.com). The prepend was not a subdomain, and would redirect to Droplr via an A record to their server's IP Address. ...
max_'s user avatar
  • 105
1 vote
1 answer
3k views

Nginx case-insensitive reverse proxy rewrites

I'm looking to setup an nginx reverse proxy to make some upcoming server moves and load balanced implementations much easier within our apps. Since our servers are all IIS case sensitivity hasn't ...
BrianM's user avatar
  • 195
1 vote
1 answer
173 views

how to make this htacess rewrite rule stop failing because of final parameter

I have this URL rewrite rule RewriteRule ^(send-your-request.*)$ / [NC,L,QSA,R=301] it should basically just remove "/send-your-request" from the the URL (i.e. rewrite it with query string ...
ChatGPT's user avatar
  • 336
0 votes
2 answers
2k views

forcing nginx to redirect to server root

I have the following line in nginx: try_files $uri $uri/ /index.html; As far as I understand, it rewrites all queries to files that are not found to index.html. Meaning, that index.html?foo=bar and ...
McFarlane's user avatar
  • 113
1 vote
1 answer
2k views

Nginx: Can I cache a URL matching a pattern at a different URL?

I have a site with some URLs that look like this: /prefix/ID, where /prefix is static and ID is unique. Using Nginx as a reverse proxy, I'd like to cache these pages at the /ID portion only, omitting ...
Josh French's user avatar
2 votes
2 answers
545 views

iis7 rewritebase for portions of website (wordpress)

We are slowly converting our existing website to a wordpress platform. I currently have 3 directories set up in a subdirectory but these need to look like they are in the site root. Example: the old ...
kristina childs's user avatar
10 votes
2 answers
32k views

nginx $uri is url decoded

I am using nginx as reverse proxy and I have 2 rules like: location ~ ^/indirect { rewrite ^/indirect(.*) /foobar$1; } location ~ ^/foobar { set $url http://example.com/something/index.php?var1=...
Carlos Campderrós's user avatar
1 vote
1 answer
197 views

Apache - How to Redirect /~username to different URL

I want to redirect ipaddress/~username/filename to http://newurl.domain.com/filename using Apache Rewrite. Can anyone point out how to do this and specifically to be able to do it for only one user at ...
Ralph Morgan's user avatar
1 vote
1 answer
2k views

Redirect loop with rewrite rule in Nginx

I have a simple static web site on Nginx, and I'm trying to implement a redirect from mysite.com/index.html to mysite.com, so it's more search engine friendly. But I get a redirect loop. I wrote this ...
gere's user avatar
  • 113
31 votes
3 answers
54k views

HAProxy reqrep remove URI on backend request

real quick question regarding HAProxy reqrep. I am trying to rewrite/replace the request that gets sent to the backend. I have the following example domain and URIs, both sharing the same domain ...
Jim's user avatar
  • 988
0 votes
1 answer
88 views

Cherokee/WordPress links to media files are WRONG

I have a problem with WordPress links to media files. It is currently pointing to (which is wrong/won't work/nothing loads): http://mydomain.com/files/2012/10/image_4-1.png The correct URL is to ...
ikevin8me's user avatar
  • 137
0 votes
1 answer
955 views

Rewrite the Base URL with mod_rewrite

My Domain example.com points to the directory public_html. In the directory public_html/php is my index.php file. Now I want that the URL example.com points to public_html/php/index.php. I must do ...
rotespferd's user avatar
2 votes
1 answer
319 views

nginx: upload progress and rewrite clauses

I'm using nginx with upload progress extension and some rewrite-clauses. Everything works fine, as long as my upload form uploads to a php file (<form action="myphpfile.php" ... >). But when I ...
Nrgyzer's user avatar
  • 123
1 vote
1 answer
2k views

JBoss url rewrite

I'm trying to rewrite the URL by defining various patterns in the standalone.xml of my JBoss configuration. This is how it looks like right now: <virtual-server name="default-host" enable-welcome-...
panmari's user avatar
  • 115
3 votes
2 answers
5k views

How do I convert Apache rewrite rules to nginx?

I'm trying to convert these rules from Apache rewrite to nginx: RewriteRule ^([^/]+)/([^/]+)?$ api.php?version=$1&call=$2 [L] I tried adding the following in the nginx config: rewrite ^([^/]+)/...
Markus Helin's user avatar
1 vote
1 answer
616 views

Using Virtual Domains with WordPress and Cherokee Web Server

I'm trying to configure WordPress to work with Cherokee Web Server. The multi-site set up in WordPress is yyy.com and uses 'sub-domains'. Thus, I have sites like aaa.yyy.com, bbb.yyy.com - they all ...
ikevin8me's user avatar
  • 137
1 vote
2 answers
1k views

nginx rewriting location of permanent rewrites

I am trying to redirect from mydomain.com to www.mydomain.com .. However, nginx is rewriting the location-header to $host. server{ server_name mydomain.de; set $root /srv/www/mydomain.de; ...
Jan Thurau's user avatar
1 vote
2 answers
3k views

nginx: URL rewrites and performance

I have a website where I need to change the URL structure. The old URLs look like /olddir/part1_de.htm, the new ones will look like /newdir/sub/category/anotherpage.htm. There are a lot of URL ...
j0nes's user avatar
  • 955
0 votes
1 answer
2k views

IIS7 URL Rewrite - Rewrite CSS files

I'm trying to rewrite certain CSS files with some rules, so it replaces every single instance of links in the CSS (as in background: url("/myuri.jpg")) with a prefix (as in background: url("/zeus/...
user1231958's user avatar
0 votes
1 answer
669 views

Apache2 URL Rewrite - Second-Level-Domain to the end of URL

i have a site "example.com" and also many other domains like "example1.com", "example2.de", etc. I want that every Second-Level-Domain is rewritten in the following way: example.com/domainredirect=...
Acryl's user avatar
  • 3
1 vote
2 answers
545 views

nginx location rewrite but proxy_rewrite off

I'm trying to use nginx for proxying requests to my internal backend. My configuration reads as follows: location /Shibboleth.sso { proxy_pass internal-backend; # ip proxy_redirect off; } ...
Jan's user avatar
  • 11
20 votes
1 answer
21k views

maintaining redirects in nginx from an external source

I am in the situation to give our marketing department the opportunity to maintain their redirects by their own. Until now, they passed the information to the IT department and we maintained it for ...
Sascha's user avatar
  • 538
1 vote
1 answer
333 views

converting apache rewrite rules to nginx

Hello everyone, I am trying to create a UDID protected Cydia Repo but I cannot use it on nginx because of nginx does not use the .htaccess file. The file certain rewrite rules to make ...
Muktadir Miah's user avatar

1
27 28
29
30 31
43