This is what I'm doing in iis manager:
iis - url rewrite -> Add rule ->
Action type: rewrite
Pattern: MySite.com (Exact match)
Rewrite url: MySite.com/Folder1/Default.aspx
So how do I return the Default.aspx page while maintaining the MySite.com in the address bar?
OK. So I found the answer:
Only the part after the domain name and trailing slash should be entered.
Related
Using Nginx I want to redirect from a list of old URLs to new.
I have a huge list like so.
few examples
https://subold.domain.com/old-path-0 -> https://subnew.domain.com/new-path
https://subold.domain.com/old-path-1 -> https://subnew.domain.com/new-path-alpha
https://subold.domain.com/old-path-2 -> https://subnew.domain.com/new-path-gamma
https://subold.domain.com/old-path-3 -> https://subnew.domain.com/new-path-2
In your old domain configuration:
rewrite ^/old-path$ http://subnew.domain.com/new-path permanent;
We have nginx setup with location proxy pass and required one specific url need to redirect or rewrite when it was hit.
Src Url:
https://application-url:port/services/app1/callback/?oauth_token=<<tokens>>
Dest Url:
https://application-url:port/services/app1/callback?oauth_token=<<tokens>>
Any solution here.
It seems src and dest url are same. if you want to rewrite the url:
then add below lines in your server
location /callback {
rewrite ^/callback(.*) https://application-url:port/services/app1/callback$?oauth_token=<<tokens>> permanent
}
I recently moved a subdomain to my main domain but I also changed the url structure.
Previously I had pages like http://sub.domain.com/companies/my-company-id/year/2012/charts
When moving to the main domain, I removed all the complicated urls to juts get:
http://www.domain.com/companies/my-company
I currently have the following rule:
rewrite ^/companies/(.*)$ http://www.domain.com/companies/$1 permanent; but when someone go on a page like http://sub.domain.com/companies/my-company/2012/charts they get redirect to http://www,.domain.com/companies/my-company/2012/charts and get a 404.
I like to force a redirection to http://www,.domain.com/companies/my-company-id regardless of what's after the my-company-id
Currently the parameter $1 is having the entire URI after /companies, so you are getting redirected to the original path. You should only extract the company-id in $1.
Use this:
rewrite ^/companies/(.*)/(.*)$ http://www.domain.com/companies/$1 permanent;
Here the rest of the URI after company-id will be available in the parameter $2, which is not needed in the rewrite condition.
Nginx redirect/rewrite Rule
How to make the configuration of nginx for redirection:
Old Url
http://www.webcheats.com.br/forum/elsword-downloads-de-cheats-utilitarios/2369461-26-04-revolution-trainer-elsword.html
/forum/ - It is the folder that installed vbulletin
/elsword-downloads-de-cheats-utilitarios/ - is the forum name that the topic / in xenforo will not appear
2369461 - is the ID that will have to appear in the url xenforo
-26-04-revolution-trainer-elsword.html - is the topic name that accessing, no matter what the xenforo because with the right ID it corrects the topic name in the URL.
New Url
http://www.webcheats.com.br/threads/26-04-revolution-trainer-elsword.2369461/
/threads/ - the xenforo automatically add the address when accessing this one topic.
26-04-revolution-trainer-elsword - Topic name, even if the xenforo system corrects'm wrong
2369461 - Most importantly, the topic ID
Another examples
Old Url
www.webcheats.com.br/forum/resolvidos/2343690-reposicao-dos-meus-posts.html
New Url
www.webcheats.com.br/threads/reposição-dos-meus-posts.2343690/
Old Url
www.webcheats.com.br/forum/league-of-legends-downloads-de-cheats-utilitarios/2516190-drophack-1-3-funcional-apenas-por-30-dias-aproveite-o-mais-rapido-possivel-veja-ma.html
New Url
www.webcheats.com.br/threads/drophack-1-3-funcional-apenas-por-30-dias-aproveite-o-mais-rapido-possivel-veja-ma.2516190/
Add this to you server www.webcheats.com.br config
location ^~ /forum/ {
rewrite ^/forum/(.+)/([0-9]+)-(.+)\.html$ /threads/$3.$2/ redirect;
}
Another option would be to not carry over the slug, as it may or may not be the same, so, might as well discard it right away, and make XenForo makes its own one.
location ^~ /forum/ {
rewrite ^/forum/[^/]+/([0-9]+)- /threads/$1 redirect;
}
I have one website with dynamic syntax
url: test.company.com/ssp/...
I would like to redirect to https
http://test.company.com/ssp/test > https://test.company.com/ssp/test
So far i have build one URL Rewrite
Pattern: (.*)
Condition: {HTTPS} / ^OFF$
Action: https://{HTTP_HOST}/{R:1}
i only can redirect to https://test.company.com/ssp
so my ssp/test string is missing
I already tried https://{HTTP_HOST}/ssp/{R:1}.
Can someone explain what i'm missing