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
136 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
525 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
495 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
184 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
163 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
13k 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
  • 513
0 votes
1 answer
73 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
35 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
837 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
  • 513
0 votes
0 answers
802 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
2 votes
0 answers
275 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
  • 513
0 votes
0 answers
399 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
274 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
267 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
866 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
504 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
131 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
109 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
1k 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
154 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
560 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
56 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
1k 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
362 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
46 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
3 votes
0 answers
81 views

Found a bug in the URL rewrite module that we can't fix. Need suggestions for outbound URL rewriting

I'm looking for some high-level options for coding around a bug I discovered in the URL rewrite module for outbound URL's. We're at an impasse with Microsoft because they need a full crash dump, which ...
Jonathon Anderson's user avatar
0 votes
1 answer
91 views

rewrite url from text cache file otherwise not found call php file

way to call cache files generated before example url : example.com/story/2022/07/18/2192547/ from /home/example/2192547.txt that's easy but i need it like if 2192547.txt found use rewrite ^/story/([0-...
Mikel Tawfik's user avatar
1 vote
0 answers
473 views

IIS 10 isapi_redirect.dll causing 500 errors until application pool is recycled

Windows 2016 server, IIS 10 and Adobe ColdFusion 2018 using Tomcat. The server has about 8 sites on it and one site is getting intermittent 500 errors. All other sites remain up and responsive. ...
Steve's user avatar
  • 139
0 votes
1 answer
263 views

How to hide page name in rewrite rules in Nginx

I am trying to hide page name from url using rewrite rules in Nginx. but its not working, please see the below example Actual url: https://super30.net/referal.php?uid=999999 Needed url: https://...
Asesha George's user avatar
0 votes
1 answer
29 views

Trying to get Nginx to transform a url ie from example.com/$uri example.com/path/$uri

when tries to access example.com without the "path" (example.com/path) I meed Nginx to add the path to the url, if it already there then ignore the rewrite. Any assistance would be welcome. ...
antonf's user avatar
  • 1
0 votes
1 answer
528 views

Blocking Port 8080 from direct IP access but allow access via domain (Virtualhost Config)

I want to access web server from http://subdomain2.domain.com from URL but not from direct IP (http://1.1.1.1:8080). For instance, below is my virtualhost config file (site2.conf) in /etc/apache2/...
Bilal Bhatti's user avatar
0 votes
0 answers
1k views

Applying IIS rewrite rules from multiple web.configs for single request

I am trying to configure a directory structure in an IIS website with rewrite rules applying at various levels. For example, consider the following structure: Default Web Site ├─ web.config └─ v1 ├─...
14207973's user avatar
  • 101
0 votes
1 answer
273 views

Is it possible to access a modified query string in a RewriteCond *after* applying a RewriteRule?

Is it possible to access a modified query string in a RewriteCond after applying a RewriteRule? What I'm trying is to apply ... RewriteCond %{QUERY_STRING} ^(.*)&?id=([^&]+)&?(.*)$ [NC] ...
user27772's user avatar
  • 111
0 votes
0 answers
17 views

using external disc for media files with RewriteRule

My apache DocumentRoot folder is $HOME/MyProject/src. Large external disc is mounted on a server on /storage path. I have a bunch of rewrite rules set on in apache .conf. For example: RewriteEngine on ...
potato's user avatar
  • 159
0 votes
0 answers
334 views

How to add dynamic subdomain to site test.mysite.com

I have requirement to manage dynamic subdomains for site like test.mysite.com BTW my current IIS has already multiple site hosted and each has SSL certificate configured. What I want to achieve is any ...
CHETAN SUTHAR's user avatar
0 votes
1 answer
934 views

Regex to remove certain patterns from urls

So i've tried this multiple times but to no avail. Basically, what I am trying to do is check if the URL has a certain language locale and remove it and do a 301 redirect to the parent url without the ...
user3321266's user avatar
1 vote
0 answers
164 views

NGINX should not change the URL in the Browser Address Bar

I hope you can help me on the following matter. I have NGINX Running and want to forward to .html (virtual pages) to index.php?view=$args without changing the URL, which is shown in the Browser ...
Berlinux's user avatar
0 votes
0 answers
238 views

IIS Redirects to multiple subfolders then errors when I use different rule name

I have a very strange issue which I couldn't figure out. In the IIS under URL rewrite module I have a redirect rule, which works absolutely fine when it is under a specific rule name, however, when I ...
Fazla Elahi Md Jubayer's user avatar
1 vote
0 answers
1k views

nginx proxy_pass change target domain in requests and responses

My Problem is: I have a server with an internal domain name service.internal.example.com which redirects all clients asking for another domain to its FQDN https://service.internal.example.com. This ...
Brolf's user avatar
  • 11
0 votes
1 answer
150 views

Nginx Redict without modifying url

I want to make a redirection from one domain to another but from one page only. Example: https://domainA.com/site/page to https://domainB.com/site/page In nginx I put: location /site { ...
Isaac Palacio's user avatar
0 votes
0 answers
105 views

Language directory rewrite to root Wordpress

I am trying to achieve following: I have language directories eg. mysite.com/en/ mysite.com/th/ and so on. I want main site/files from root directory will be diplayed when someone enters mysite.com/en/...
INT's user avatar
  • 1
1 vote
1 answer
251 views

On Apache how to switch off DirectorySlash only for requests to a specific subdomain?

Served by Apache I'd like on one subdomain site of mine (say sub.mydomain.com) that URLs without trailing slashes point directly (without external redirect) to the index file in the underlying folder. ...
halloleo's user avatar
  • 163
1 vote
1 answer
2k views

Trying to get Apache to serve webp instead of png/jpg (from /img folder of prestashop)

First post here, so I hope I did it well. I converted all png/jpg starting from my prestashop public_html folder to webp, and added rewrite rules to the .htaccess in order to have the webp served ...
Totoro's user avatar
  • 13
0 votes
1 answer
548 views

nginx reverse proxy IP_adr/1881 to localhost:1881 proxy_pass

I have read this post, and try many thing but i have issue with rewrite regex. here I have many node.js processes as backends with always different port to access. With Nginx reverse proxy in the same ...
dinastar66's user avatar
1 vote
1 answer
4k views

My IIS URL Rewrite rule is not working for my IIS website

I have an IIS Server on Windows Server 2016 where I host one website. The site is using bindings so that both of these domains, astro.resources.teams.org and astronomyteams.org, goto to the same ...
SkyeBoniwell's user avatar
1 vote
1 answer
3k views

rewrite rules from apache to nginx

I have a problem with this... I'm using free hosting for giving a demo to my future buyers of my own cms. The hosting is hubuhost.com, they are supporting the last version of php 8.1. The problem is ...
pok4's user avatar
  • 13
0 votes
1 answer
462 views

Nginx ingress - escape characters

I have the following ingress conf that is exposed via nodePort 32100. When I call (curl) the URL [1] which contains parenthesis, I get HTTP 500 error. But when I call the URL [2] which contains no ...
user515576's user avatar
0 votes
0 answers
255 views

rewrite rule nginx for everything in a domain

I'd like to make a rewrite of my domain name.domain.tld to another URL. I managed to do this but if I type name.domain.tld/dashboard or anything after the tld I still get the content like without the ...
Iron Dude's user avatar
0 votes
1 answer
546 views

nginx - Attempt to redirect path with variable internally fails

i would like to redirect the request to a file from /path/to/file/content?path=file.pdf to /new/path/to/file/file.pdf under the same domain. I tried simple rewrite rules or like this. location ~ ^/...
Christian's user avatar
0 votes
1 answer
811 views

Why can I write one set of URLs but not others with NGINX?

I've set up NGINX, version 1.18.0, as reverse proxy for my Apache Superset 1.4.0 installation. I'm trying to capture some URL patterns, and rewrite them by adding standalone=1 at the end. The ...
Emre Sevinç's user avatar

1
2
3 4 5
43