nginx case insensitive url redirection [closed] - regex

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I want to do case insensitive url redirection in nginx
Below is my code.
location ~* WapsiteDataFetch{
rewrite WapsiteDataFetch(.*) http://images.xample.com/xyz/images$1 permanent;
}
In the above case ,
www.example.com/WapsiteDataFetch is redirected properly to http://images.xample.com/xyz/images
however, the url "www.example.com/WAPSITEDATAFETCH" is not redirected properly.
Even if I Change a single character it is giving 404 error.
I have tried many blogs and seen many post from stack overflow and many of them have suggested "~*" but in my case it is not helping me.
please help me as I am stuck on this for a couple of days.

Use (?i) to match case-insensitively - http://perldoc.perl.org/perlretut.html
Location block is not necessary. Try this.
rewrite (?i)^/WapsiteDataFetch(.*) http://images.xample.com/xyz/images$1 permanent;

you can avoid using the regex engine twice, by doing the capturing inside the location block
location ~* WapsiteDataFetch(.*) {
return 301 http://images.xample.com/xyz/images$1;
}

Related

What is the right way to edit 'cname' with period at end? [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 days ago.
Improve this question
I was experimenting with custom domains in Firebase Auth .
should the period be used when entering the cname
so should the cname should be
mail-example-com.dkim1._domainkey.firebasemail.com.
or
mail-example-com.dkim1._domainkey.firebasemail.com
It doesn't matter with or without but I tend to leave it in-place when it's automatically placed there.

Looking to modify host file in MacOs [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I am following a tutorial on multi-tenancy in Django (10:58/11:42) and I would like to modify the hosts file which I located alreadty. When I try to add a single letter, I get rejected:
But this leaves me quite confused, this is my laptop, and I do not have permission? Is there a way to do this differently ?
In the terminal type sudo nano /etc/hosts and then hit return.
Enter your administrator password and then hit return.
Then you should be able to edit the file.

Blocking ?page= in robots.txt [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
Basically Google is trying to index thousands of articles that all look something like this:
/questions/are-eggs-bad-for-you?page=69
The urls range from page=1 to page=99 due to my pagination and infinite scroll.
How can I include just the ?page= part of the url in my robots.txt file so it does not index anything with a page number?
Not sure if this is the correct place to ask this question, but I am having an overly hard time finding an answer. Thanks.
for Google, preferably do it through google webmaster tools, go Crawl-> URL Parameters:
Add a parameter page, choose its effect as Paginate and Crawl only Value=1
Read more about Search Console Help - Learn the impact of duplicate URLs

Custom wildcard configuration in postfix [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Is it possible to use wildcards in the postfix virtual file?
Instead of allowing #mydomain.com I would like to know whether I can permit a specific configuration of an email address, for example I would like all these to be accepted:
xyzabcTRE456#mydomain.com
xyzabcFRS869#mydomain.com
xyzdefGLY643#mydomain.com
Could I have a single line regex-type entry in the postfix virtual table to cope with these permutations?
Thanks
Tim
You can use configuration parameter check_recipient_access in your smtpd_*_restrictions.
e.g, your main.cf should contains
smtpd_recipient_restrictions = other rule, other rule,..., check_recipient_access regexp:/etc/postfix/access.me,...
Then /etc/postfix/access.me should contains your regex. This page and this page should help you.
/^xyzabc/ OK

How to prevent opening my website with ip [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I want to configure apache web server to prevent opening my website by ip address.
For example if my website is "domain.com" and my server ip is "111.222.333.444", you should not open my website by entering "111.222.333.444".
How can I do this?
Thanks for your help.
This should work in your DOCUMENT_ROOT/.htaccess file:
RewriteEngine On
# block request by IP address
RewriteCond %{HTTP_HOST} ^111\.222\.333\.444$
RewriteRule ^ - [F]