Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
12 views

How to use Apache forward proxy server to rewrite URLs?

So I have successfully set up an apache HTTP server as a forward proxy. Next, how should I modify the configuration file so that clients type ANY URLs, and the proxy rewrites the URL to something else?...
0
votes
0answers
20 views

Redirect rules for two separate catch-alls

I am not a systems admin and am struggling getting some .htaccess rules to play nice. The issue is I need a two-tiered fallback. Sample directory structure: /public_htmlindex.html (vue app with ...
0
votes
1answer
19 views

How to change rewrite to location [nginx]

I have (SEO friendly) URL https://website.com/page and it links to https://website.com/page.php I am using rewrite rule rewrite ^/page /page.php break; Is it a "perfect" solution? I have seen lots ...
1
vote
1answer
30 views

htaccess issues with non existent files in non existent directories [duplicate]

I am using the following .htaccess file, which works well, however, I want to also forward any attempts to access non-existent files in the root directory and in any subdirectory (whether the ...
-2
votes
0answers
13 views

htaccess rule not working on server [duplicate]

my htaccess rule not working on server its working fine in localhost RewriteEngine On RewriteRule ^services/([a-zA-Z0-9\-]+)?$ services.php?service=$1 [NC,L] RewriteRule ^blogs/([a-zA-Z0-9\-]+)?$ ...
0
votes
0answers
32 views

nginx rewrite all static excluding directory

I have these codes and it works fine, but with this way i should permanently indicate all directories to redirect. But there are a huge ammount of directories in my server.... location ~ ^(/akkerman-...
0
votes
0answers
10 views

Keep encoded URLs when rewriting in Nginx

I have a rewrite which rewrites /test/id/:urlencoded to /test/:urlencoded location ~ /test/id/ { rewrite ^/test/id/(.*)$ /test/$1 redirect; } It looks like Nginx decodes the captured portion. For ...
-1
votes
0answers
35 views

Nginx URL Parameter Check

I'm looking to redirect a URL to Google when it is of this pattern. https://example.com/SOMETHINGHERE?_=ANY_STRING_HERE I'm not sure if I can do this via $arg_ or would I have to use something else. ...
2
votes
1answer
42 views

How to redirect with query string in Nginx

I would like to redirect: something.com/search?keywords='value' to something.com/search?q='value' Here is my Nginx config: location ~ /search { if ($args ~* "keywords=(.*)") { ...
-1
votes
0answers
19 views

Serve different file for crawlers

I am working on an SAAS product whose front is built with angular, each merchant on software has unique subdomain for their frontend like user1.saasproduct.com and they can change their title and ...
0
votes
1answer
32 views

nginx URL Redirect

Excerpt from conf file server { #HTTP SITE listen 80; server_name example.tv www.example.tv; #Redirect HTTP to HTTPS location / { return 301 https://example.tv$request_uri; ...
0
votes
0answers
12 views

IIS Rewrite language on all matched URL's

I'm trying to write a rule in my IIS that replaces all URL's that are matched with the turkish language to the english language. example: I want http://example.com/test.aspx?lang=tr to be forwarded ...
0
votes
0answers
16 views

How to setup web.config and IIS for second and separate FQDN in IIS on same ports

I've got an existing website that is running on 80 and 443 with SSL already. I have a second FQDN that needs to access a different web application. My second application is Seafile. I've followed ...
0
votes
1answer
17 views

IIS and Apache rewrites and redirects working together

I'm having some trouble with IIS and apache working on the same server. Specifically, any redirects that apache does don't replace the website domain with the target domain. Here's an example: Trying ...
0
votes
2answers
143 views

nginx rewrite url without changing browser address

I want to change the url of a request but the browser address should not change. To achieve this I have tried the below configuration: location /my-website { proxy_pass http://tomcat/...
-2
votes
2answers
36 views

Browser does not have rewritten URL with query string

When I rewrite the URL by adding a query string, the URL in the browser does not have the query string. Here's what I have: location / { rewrite ^/$ /?page=test break; } Instead, I see the ...
0
votes
0answers
21 views

reroute request by port in iis7

I'm trying to set a webapp in iis 7 to forward requests to a specific port to a controller inside the website. I need that every request sent to http://server:6035/{QUERY} will be rerouted to http://...
0
votes
1answer
17 views

Redirect in nginx port not showing up

I have the following configuration. I'm trying to redirect the http traffic to port 8443. I'm running gogs on different ports and am using some tricks to get to it. Now our main portal is guarded by ...
1
vote
0answers
35 views

How to manage URL rewrites with a GCP load balancer?

We have a single-page web application deployed on a GCP bucket with a load balancer in front of it. All URLs such as example.com/login should be rewritten as example.com/#/login. Without being ...
0
votes
0answers
13 views

IIS URL WWW Rewrite Working, But Can Be Gotten Around

I have the following rewrite rules to add www when someone visits our sites: <rule name="non-www to www http" enabled="true" stopProcessing="true"> <match url=".*" /> <...
0
votes
0answers
30 views

nGinx Case Insensitive Rewrite Causing Redirect Loop

I am attempting to get my case-insensitive rewrite correct, and am running into what looks like a redirect loop issue My config block is location ~* ^/email { rewrite (?i)^/email/(.*)$ $scheme://...
1
vote
1answer
53 views

.htaccess 301 redirect remove [] from the URL

I want to remove '[' and ']' from the URLs and redirect to correct link. Here is a sample URL: /forums/garage-150/cool-cars-sightings-[archived]-7610/index127.html Needs to be redirected to: /...
0
votes
0answers
23 views

rewrite url for proxy and preserve original url for client

I have an issue with nginx and proxying. There are two aplications which serve requests on :8080 port and I'd like to setup nginx proxy and connect to applications using following urls: http://domain/...
0
votes
1answer
59 views

nginx rewrite if query string exists

In the past a project was getting moved from / to /subdir. As the old URL structure was something like /index.php?foo/123/bar I used the following rewrite to get everything to /forum: rewrite ^\/...
2
votes
1answer
72 views

Redirect to %-encoded URL parameter using mod_rewrite in .htaccess

There's a couple of things I'm trying to understand in relation to a RewriteRule. The working rule on a URL strips a query back to a redirect, eg. the URL: https://www.example.com/application?user=...
0
votes
1answer
54 views

rewrite rule on nginx for css js files not work

I use laravel framework for my website on nginx server I need to apply rewrite rule on nginx its a sample: site.com/play/gamename/css.css --> site.com/uploads/games/gamename/css.css or site.com/...
0
votes
0answers
47 views

How to reverse proxy a suburl to a port

I have Jupyter running on port 8888. I used the following to reverse proxy that port to jupyter.myserver.com. <VirtualHost *:80> ServerAdmin admin@myserver.com ServerName ...
2
votes
1answer
52 views

Change url with htaccess

All url on my website have url: www.domain.com/name+name+name+name How change all url to: www.domain.com/name-name-name-name my htaccess is like this: <FilesMatch "\.(htaccess|tpl)$"> Order ...
0
votes
1answer
45 views

IIS url rewrite to another port

I need help with a strategy on how to think regarding IIS - URL rewrite - Application Request Routing. Example Let's say that I can access my web server from outside my wifi via http://2X0.2X1.2X2....
0
votes
1answer
87 views

How to limit outbound rule scope to a specific site using url rewrite on IIS

I am using url rewrite on a IIS to act as an reverse-proxy. One of the http services behind the proxy is a portal. The html returned by the portal as many resources that are referenced using a ...
0
votes
1answer
63 views

Rewrite then Basic Auth with Apache for Cloudfront

I have a website where all pages go through AWS Cloudfront (right now with a TTL of 0). The site domain is www.example.com, which is a CNAME to the cloudfront distribution. Cloudfront then requests ...
0
votes
1answer
23 views

Nginx show 404 if URL end with extension ( ttf | mp3 | mp4 | webm | ogg | jpg | jpeg | gif | ico | css | js ) [closed]

Issue with Nginx Url rewrite , it show's 404 if URl's end on any of these ( ttf | mp3 | mp4 | webm | ogg | jpg | jpeg | gif | ico | css | js ) Example URL . example.com/convert-to-ttf example.com/...
0
votes
1answer
21 views

nginx rewrite phpphumb & cache-control

I want to use phpthumb generator & add some custom expires header to all images When I use only phpthumb rewrites it working but when add cache-control rewrites can't generate new thumbs my code ...
0
votes
1answer
23 views

How to redirect all requests except when there's an exact string match

Requirement- I want to redirect all requests that end with /abcd to /products/abcd This should match all urls such as these- /collection/abcd /collections/all/abcd /hello/world/abcd This is what i'...
0
votes
0answers
48 views

Nginx proxy_pass to wordpress blog

I'm trying to serve a wordpress blog from another domain using proxy_pass. https://blog.domain.example/ to https://domain.example/blog I clearly also want to rewrite all the urls accordingly. What ...
0
votes
1answer
37 views

convert from IIS rewrite to nginx

I need to convert an IIS rewrite rule to NGinX rewrite. I made a small progress because I don´t know how to convert parts of IIS rules. Here is my IIS config: Matches the Pattern: ^(.*)$ Rerite URL: ...
0
votes
0answers
140 views

IIS 10 URL Rewrite HTTP to HTTPS redirect on same port

I would like an easy redirect but doesn't work. Original: http://exwebsite.com:8084 to Redirect: https://exwebsite.com:8084 Can u help me? The simple <add input="{HTTPS}" pattern="off" /> and ......
2
votes
0answers
37 views

HTTPS redirect, exclude script parameters from URL [closed]

My goals: 1. http://example.com/page/index.php -> https://example.com/page/ 2. http://example.com/page/ -> https://example.com/page/ 3. http://www.example.com/page/ -> https://example.com/...
0
votes
0answers
36 views

Nginx rewrite query args string

I'm trying to redirect a bunch of old URL's to a new structure but having problems rewriting query arguments. My URL's are in this format: https://www.example.com/?views_qualities_groups=water-views/...
1
vote
1answer
44 views

Nginx htaccess for query string in redmine

this is a question from Does not work nginx htaccess for special page in redmine I am repeating: I have system of management of projects redmine. Also, i have nginx, like reverse proxy for redmine. ...
0
votes
0answers
48 views

Shorten URL with Nginx

I have this long URL with http://shortk8s.com/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/#!/workload?namespace=default I'd like to http://shortk8s.com to go directly ...
0
votes
1answer
53 views

How to debug why enabling mod_proxy_html results in a blank page?

Background I have four Windows servers, running Server 2012 R2, running Apache 2.4 on each. These are arranged into two pairs of load-balanced web servers, with the first pair facing the internet, ...
0
votes
0answers
36 views

Redirecting all subdirectories to subdomain with subdirectory

Using NGINX, I want to redirect domain.com/support/* to support.domain.com/*. I have the initial domain.com/support to support.domain.com redirect working, but I'm not sure how to make it dynamic: ...
0
votes
1answer
48 views

Nginx Node Proxypass Result to Variable

I want create some rewrite with nginx (5 million links), I read nginx have the option to save it in a map file but need ages to reload + ram usage when I do it this way. My Idea was now User -> ...
0
votes
0answers
50 views

IIS Url Rewrite - Can I combine multiple optional query string parameters into a single value?

Given an original inbound url such as https://testdev.mydomain.com/Twilio/Inbound/? ToCountry=US&MediaContentType0=image%2Fpng&ToState=TX&SmsMessageSid=FAKEVALUE&NumMedia=1&ToCity=...
0
votes
1answer
90 views

Nginx SSL-rewrite to localhost

I want to redirect localhost request to HTTPS. This is what my .conf looks like: server { listen 80; listen 443 ssl; ssl_certificate /etc/ssl/localhost.crt; ssl_certificate_key /etc/ssl/...
0
votes
1answer
146 views

Apache Httpd 2.4 Rewrite Rule to return 301 redirect, but returns 302

I have two different examples of where Apache Httpd 2.4 on Centos7 is configured to perform redirects with the R=301 flag, but they are actually returning 302 redirects. One is an extremely simple ...
0
votes
1answer
45 views

port RewriteRule from apache to nginx

we have a large php application running on apache now which I would like to migrate to nginx. I’ve got everything to work correctly except for a RewriteRule in a .htaccess file. The web app allows ...
0
votes
1answer
32 views

PHP Web site cannot run properly on IIS

We run a main site and want to run a second site under /tesmer folder. On the demo site it works perfectly. When I upload it on a Windows server just /tesmer/ displayed correctly. Any subpages likes /...
0
votes
0answers
233 views

IIS HTTP Error 502.3 - Bad Gateway The operation timed out using rewrite

I'm on a Windows box, receive HTTPS request and forward/proxy them to another (internal) server. This is done through a rewrite in the web.config file: <rule name="ReverseProxyInboundRule1" ...