Questions tagged [rewrite]
43 questions
14
votes
6 answers
How to remove double slash in URLs served by nginx?
I need to replicate the following Apache rewrite rules in Nginx config on Ubuntu 12.04. What is the nginx equivalent to :
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
codecowboy
- 740
- 4
- 15
- 34
14
votes
1 answer
Nginx: Serve static files out of a given directory - one level too deep
I'm pretty new to nginx configs. I'm having some difficulty with a pretty basic problem. I'd like to host some static files at /doc (index.html, some images, etc). The files are located in a directory called /sites/mysite/proj/doc/.
The problem…
Joe Jasinski
- 528
12
votes
2 answers
The Module DLL C:\WINDOWS\system32\inetsrv\rewrite.dll failed to load
I just upgraded to Windows 10 from 7. Cool so far, but when I try to go to any of my applications the app pool crashes and I get a 503. I can restart the app pool but it continues to crash. So I checked the event log to see what was happening. I…
DeadlyChambers
- 463
9
votes
1 answer
How is Apache mapping files without extensions?
My local dev setup is mapping things like http://mydomain.dev/testhtmlpage to testhtmlpage.html and http://mydomain.dev/testphppage to testphppage.php. The browser stays on the orginally enter URL. The thing is I didn't configure my machine…
Denis Hoctor
- 225
5
votes
4 answers
Redirect browser to different host and port
Background, Running windows 7, FF3.5, and am an admin. I recieve emails from an internal company service that has links. The problem is the links don't work from my office. If the resource is http://sub1.sub2.domain.com/page.html, I need to go to h…
DanInDC
3
votes
4 answers
What Firefox functionality do I use to rewrite and open the URL of the active page?
Our university provides a proxy service that allows me to browse websites as if I was online via the university network. However, lazy as I am, I get tired of going to the URL edit field in Firefox and change the https://superuser.com/ to…
Egon Willighagen
- 467
3
votes
3 answers
Can't figure out why this regex doesn't apply
I am using Privoxy 3.0.10.0 to filter web pages before they're passed on to the browser.
I can't figure out why this simple regex doesn't trigger a rewrite. Maybe someone more experienced will have an idea:
Here's what it looks like when I hit…
OverTheRainbow
2
votes
0 answers
Url rewriting faliure in case of UTF8 urls in nginx
I am using Nginx webserver and I want to rewrite some old urls on my site to new ones inorder to prevent 404 errors. For English urls everything is OK and adding a rewrite rule like the following to the server block works fine.
rewrite ^/omid/$…
omidrezav
- 21
2
votes
1 answer
dokuwiki, nginx and farms
I am attempting to setup multiple dokuwiki's but I am really struggling...
I can set up one with relative ease but I would like to make use of the farm concept ( https://www.dokuwiki.org/farms ). The downside is it is written for apache not nginx…
Naib
- 264
1
vote
1 answer
Nginx catch all domain, then add www if not present
This setup is for multiple domain sharing a single CMS platform. It will allow any domain to point to my server ip.
I can use nginx server_name _; to catch all.
But then I would like to 301 redirect to www (appending www. infront) if www is not…
Syed
- 11
1
vote
0 answers
Ubuntu 14.04 Nginx Rewrite rule issue
Problem with nginx mod rewrite. Really appreciate help. I spent hours on that issue
Problem with rewriting url.
I want rewrite from bangots.eu/?subtopic=highscores bangots.eu/?subtopic=houses
to get this
bangots.eu/highscores bangots.eu/houses
I…
Szmycu
- 11
1
vote
1 answer
htaccess file works for Chrome & IE, but half-way in Firefox
I tried to use .htaccess file to redirect http:// to https://
I also tried to append www. in front of domain-name, if it is not written.
I used this code in the .htaccess file
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
Options…
Victor Ivanov
- 112
1
vote
1 answer
Why would Chrome rewrite links within pages from the http:// to https:// scheme?
I'm completely stumped with this issue:
When visiting a website which is a virtual host, without SSL support and with no reference to any https:// scheme within its database, or any file within it's themes, configuration etc. (this is a WordPress…
zoot
- 131
1
vote
2 answers
Apache rewrite downside?
Say I have my website stored on domain.com/mysite
I add a rule in .htaccess to rewrite the URL to domain.com
Is there any downside to storing the site in a subfolder and rewriting the URL like this? Or is this standard practice - Possibly having…
Patrick
- 11
- 2
1
vote
2 answers
Nginx-Remove WWW from HTTPS
I would like to ask for some help with the following Nginx configuration, so that URLs such as https://www.mywebsite.com get rewritten as https://mywebsite.com. I am currently using the following configuration:
server {
server_name…
NetStudent
- 229