As of May 31, 2023, we have updated our Code of Conduct.

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
0 answers
71 views

Kubernetes Nginx Ingress url rewrite for dynamic id in url

I'm running a Kubernetes cluster on Azure Kubernetes Service(Aks). Currently, I'm having a service called product-service and I have exposed it to the outside using Nginx Ingress. My current ingress ...
Pasindu Prabhashitha's user avatar
0 votes
0 answers
59 views

IIS and reverse proxy outbound rules

I am trying to setup a reverse proxy using IIS 10 on Windows Server 2016 that must pass requests to an Apache Tomcat webapp. It works for URLs within the 'basic' tags (such as a or img), but I need to ...
stefanu's user avatar
  • 13
1 vote
1 answer
47 views

Apache 2.4 expr - how to load a html file via RewriteRule?

On Apache 2.4, Having a bunch of mixed SEO friendly and dynamic URLs on an ecom site I want to implement a simple caching system for my blog posts and product pages. First I want to have md5(...
nikis's user avatar
  • 11
0 votes
1 answer
40 views

nginx rewrite both .php and .html

Have 2 rules for working files with (html, php) prefix and without. But working only first rule. If first php, second with html prefix show not found. if (!-e $request_filename){ rewrite ^/([^\.]+)...
oim's user avatar
  • 1
2 votes
1 answer
159 views

nginx: How to write regex to split URL into host and "everything else"?

I want to map https://www.example.com/Something/SomethingElse/ to https://www.example.com/index.php?/Something/SomethingElse/ So far I understood that I need the location directive in nginx and use ...
Александр Кулагин's user avatar
0 votes
0 answers
23 views

Apache rewrite url in wsgi site

This is my apache site with wsgi application. What I need is add string "Auth_Basic" between last slashes in the request. Request can be different anytime. Example: http://127.0.0.1/asd/lala/...
Dominik Štumper's user avatar
0 votes
0 answers
36 views

deny direct access to folder but allow rewrite redirection

I have a question about htaccess. I have a rather complex website structure on the server and I use htaccess for redirection. the site structure is as follows web/project/test_project/ ├─ admin/ ├─ ...
Jan Hrabovsky's user avatar
0 votes
1 answer
186 views

nginx url rewrite regex with special characters

How to write a regex that matches a path node with reserved characters like '+','-' ? for example: https://e.example.com/foo+/bar/file/test.txt need to be re-written as https://e.example.com/bar/file/...
Pahan's user avatar
  • 3
1 vote
0 answers
48 views

Cloudfront url routing to a domain

I have a cloudfront url I want to route to demo.example.com. I used nginx for the routing and configuration and generated the ssl certificate and then added the txt records in the DNS portal. But when ...
Manoj Mandala's user avatar
0 votes
0 answers
56 views

NGINX rewrite url with arg

We need to check if a URL contains a specific arg "?___store=en" and then redirect to the same url, but add /en/ after the domain name. But this should be dynamic, because the url is not ...
JGeer's user avatar
  • 113
1 vote
0 answers
32 views

Problems with excluding an url from being redirected

I'm retiring the legacy site http://extranet.contoso.com but there's a specific functionality that will be needed for a while still. What I'm trying to achieve is the redirection of all requests to an ...
PeterL's user avatar
  • 11
-1 votes
1 answer
243 views

IIS Redirect - Hostname to Alias with only HTTP Redirect

I have a Windows 2016 server (FQDN: server1.domain) in an Active Directory domain. I am hosting intranet web apps in IIS. I recently got an alias (FQDN: CoolName.domain) for that server created in the ...
moosearch's user avatar
0 votes
1 answer
36 views

Nginx custom 301 rewrite

I am struggling to find how to write this scenario 301 redirect to nginx: https://mydomain/$ to be converted https://mydomain/en_us/$ Actually I need to add "en_us" just after mydomain and ...
G. G.'s user avatar
  • 143
0 votes
1 answer
132 views

RegEx for 301 redirects to change path AND remove a string

I am looking for an RegEX redirect rule to redirect the image file locations to a new location, whilst also removing part of the original url which is the name of the image OLD URL: /components/...
Rebecca Hubbard's user avatar
0 votes
1 answer
246 views

Writing a RewriteRule based on X-Forwarded-Host

I have an Apache webserver behind a load balancer which proxies request to Apache and have problem regarding configuring directories. Here is my scenario: Upper Load Balancer proxies request to ...
Ageniz Shop's user avatar
0 votes
0 answers
156 views

IIS Rewrite URL not working after configuring SSL cert for reverse proxy and application server

We have a webserver with IIS reverse proxy and apps server with application, configured reverse proxy with http and the reverse proxy rules works fine. The same application and reverse proxy after ...
DR Bot's user avatar
  • 1
0 votes
0 answers
208 views

Setting up a secure proxy on IIS 10 for HTTPS tunneling

I am trying to set up an IIS 10 (Windows 2019) to tunnel HTTPS traffic to a REST API of an application server at our customer location. Tunnelling HTTP traffic was no problem and works like it should ...
SaschaM78's user avatar
  • 113
1 vote
1 answer
128 views

Nginx how to make redirect by removing part of URL with regex mask?

I need to redirect from URL like example.com/some-urltext-nav.html to example.com/some-urltext.html (remove "-nav" only). I've tried some regular expressions in server block like rewrite ^.*?...
Oleksandr's user avatar
1 vote
1 answer
153 views

Force https on all website except one on IIS

I followed this example "Best way to redirect all HTTP to HTTPS in IIS" for redirecting to https and it worked great. I just have one website that is the exception. It has a few non-https ...
ErocM's user avatar
  • 226
0 votes
0 answers
35 views

apache2 reverse proxy, how to serve multiple domains with backend recognizing only 1 valid uri

I have an Apache reverse proxy set up and my backend service is configured on a specific static ServiceUri="site.com". I would like requests coming for multiple domains a.site.com/data, b....
Mnemosyne's user avatar
  • 131
0 votes
1 answer
172 views

How to redirect URLs containing random string in Nginx

In my access log I've got random a lot of query strings, it is something like this https://example.com/?rJWLuVR1=JXhedT2G https://example.com/?JuntjUsc=kfLAIJCx https://example.com/?...
user3195859's user avatar
0 votes
0 answers
230 views

How to remove part of an URL in Nginx?

I want to automatically remove /feed from the URL For Example: example.com/blog/something/feed/ to example.com/blog/something/ Could someone tell me how to do this in Nginx?
Subhash's user avatar
  • 171
0 votes
0 answers
46 views

iis - Redirect URL by numeral in order

Good afternoon people. The issue is that I was testing redirecting pages and I ended up having to repeat the code 11 times. But I believe there is a way to automate this. If anyone can help me. What I ...
xzmaster's user avatar
0 votes
0 answers
94 views

Nginx : Get last value of URL

I am posting here because I have not found an answer to the following problem. I have the following url: https://www.example.com/archives/5852555.pdf and I need to keep only 5852555.pdf to pass this ...
outstore's user avatar
0 votes
0 answers
105 views

Rewrite subdirectory to root (Apache)

We have a mod_rewrite question here about going from subdirectory to "root" Here are a few strings : /fr/spil/spil-til-pc/steam/publisher/dovetail-games /fr/spil/franchise/little-nightmares/...
JoyBuggy's user avatar
0 votes
0 answers
128 views

Nginx rewrite - not working - convert from htaccess

I have a .htaccess file and I'm trying to convert it to an NGINX URL Rewrite configuration. Unfortunately, none of the available converters help. Every time I get either a 403 error or 'No input file ...
Przemo Memo's user avatar
0 votes
1 answer
5k views

Nginx http to http redirect 400 The plain HTTP request was sent to HTTPS port

i have an app that is exposed at http on port http://app1.internal.example.com:8080 and https on port https://app1.internal.example.com:8443 so i have the 80 and 443 nginx server block to help ...
uberrebu's user avatar
  • 503
0 votes
1 answer
36 views

how to setting nginx extension wildcard

i want to hiding my extension like .php but it's not only to hiding, if i enter the index.do nginx rewrite to index.php but, url address must be the same (index.do) In summary, what I specifically ...
Boot Re's user avatar
0 votes
1 answer
27 views

NGINX Crossed Mappings

I appear to have a issue with my mappings in my NGINX configuration. The first mapping handles UserID or Username. The second mapping overrides the first mapping, and is forcing token in place of id ...
Jonny's user avatar
  • 1
0 votes
1 answer
162 views

nginx redirect multiple server names with non-standard port in url

I have an endpoint like https://app1.company.com:5555 and will like to be able to browse the website with the port number in the url for all pages and also be able to browse without the port number at ...
uberrebu's user avatar
  • 503
0 votes
0 answers
427 views

Want to redirect URL and change slug to url parameter

I am stuck with a mod rewriting on Apache htaccess. my URL looks like this : http://localhost/Ac5GRnXW I want it to redirect like this: http://localhost/redirect.php?id=Ac5GRnXW I am using the ...
Anjali's user avatar
  • 1
0 votes
0 answers
24 views

Apache mod_proxy redirect

I have 2 domains, both on the same server. One of them is running a website. I have a subpage of that website that I want to map the other domain to. The goal is to have the domain www.something.com &...
Michal's user avatar
  • 101
0 votes
0 answers
192 views

Rewriting URL in mirror location context in Nginx

In Nginx I have been trying to mirror traffic from one web server to another as follows http://localhost:8008/var1/var2/ -> http://localhost:8009/var3/var4/ this is my nginx mirror ...
shubham wable's user avatar
0 votes
0 answers
49 views

Rewriting URL encoded with htaccess

have a single page website that uses the hash (!#) to access different pages. he problem is that some product viewers break my links encoding the hash character, replacing !# with domain main , so for ...
Dieu Vu's user avatar
2 votes
0 answers
172 views

Rewrite cname host mapping url paths with nginx

There is currently an app that is using cname host mapping with a third party app the hostname for the third party app is mycompany.partner.com and the current cname host map under my domain help....
uberrebu's user avatar
  • 503
0 votes
0 answers
100 views

Postfix: Rewrite header FROM sender based on sasl login username

Lets say I got a sasl login user called myloginuser. The user owns the domain: example.org and has set up following email address: sid@example.org myloginuser is authenticated and wants to send an ...
TomGrill Games's user avatar
0 votes
0 answers
153 views

Issue with Nginx Url Rewrite /Redirect

For new site config I tried NGINX rewriting for the blog plan and keep the paths the same, just redirect from 'www.' to 'blog.'. and plan for RSpace API and CME have been configured and the ALB. www....
santosh baruah's user avatar
0 votes
1 answer
143 views

nginx append query parameter with encrypted value to a react application

I want to send the DN field from the client certificate ($ssl_client_s_dn), but I want to send it encrypted. In the question nginx append query parameter to a react application it is explained how to ...
Ximo Dante's user avatar
0 votes
1 answer
187 views

nginx remove all query parameters and add a new one to a react application

I want to discard all the query parameters and add a new one (for instance DN=$ssl_client_s_dn). The reason is to prevent the client from sending this query parameter. Replacing the value of the query ...
Ximo Dante's user avatar
1 vote
1 answer
415 views

nginx append query parameter to a react application

I am a beginner in Nginx and I want to append a query parameter to the URL (for instance myid) in order to serve a react application. I am using nginx/1.18.0 (Ubuntu) There are similar questions like: ...
Ximo Dante's user avatar
0 votes
1 answer
267 views

Nginx - fastcgi cache not working for rewrite enabled php page

I've been trying to figure out why Im failing to achieve fastcgi caching for a rewrite rule applied php page. While all other request wonderfully cache, the rewrite ^(.+)/special/?$ /inc/special....
TheMonkeyKing's user avatar
1 vote
0 answers
76 views

How to remove number from the URL?

I have wordoress site where I am getting /1 in the URL. I have checked siteurl,homeurl,permalinks but not sure why /1 is getting added in the URL e.g https://example.com/consulting/strategic-marketing/...
user8863627's user avatar
0 votes
0 answers
68 views

nginx rewrite complex urls

I need some help to rewrite the following url and I didn't find the solution: I need to rewrite the url: http://ip_address/number/file to: http://ip_address/only_last_three(number)/file-number where ...
Santiago Alberch's user avatar
3 votes
2 answers
987 views

seo friendly url not working

I have a folder structure like the below www.exampe.com/distributor/index.php and I want to access the file via an seo friendly www.example.com/distributer/abcinc and then in the index.php want to ...
Jayreis's user avatar
  • 145
1 vote
0 answers
88 views

when it goes to https:/... directly it is missing the referer part

it's all about cookies ,it suppose redirect to ?referer_id=186 every time which is refresh the cookies of new logo but i notices when user delete or clear the history of Brower and try to visit the ...
Momen Rashad's user avatar
0 votes
1 answer
233 views

Apache mod_speling re-writing all URLs to lowercase

I have inherited a website where the URLs contain capitalization, but the file structure on the server is all lowercase. This wasn't an issue until moving the site over to Apache. I don't want to ...
PublicDisplayName's user avatar
1 vote
0 answers
45 views

rewirterule in apache conversion to nginx equivalent rewrite rule

Apache server rewrite rule has been written below: RewriteEngine on RewriteRule "^/cesop(.*)$" "http://LSVCHN-EPAP01/cesop$1" [P] In Internet browser, type below: https://...
Radhakrishnan Meiyappan's user avatar
1 vote
1 answer
448 views

nginx rewriting static asset to different path

I have a main app located at root: /app/web. Then another app within a subdirectory - /app/web/second. Pages are located in /app/web/second/<env>/page. Assets are located in /app/web/second/<...
Allan Thomas's user avatar
1 vote
2 answers
184 views

Nginx rewrite to specific part of requested uri

I am quite new to nginx rewrite concept and I can't figure out how to rewrite the requested_uri to a specific Uri. I am trying to make rewrites to specific js files. For example, I have this ...
dimpap's user avatar
  • 11
0 votes
0 answers
28 views

apache mod_rewrite path to querystring - keep base directory

I try to "beautify" my URLs from eg. www.example.com/page.php&id=3 to www.example.com/page/3 I can achieve this with: RewriteEngine On RewriteRule ^(page)/([0-9]+)$ page.php?id=$2 The ...
peter's user avatar
  • 1

1
2 3 4 5
43