Regex 301 Redirect .htaccess file [closed] - .htaccess

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 4 years ago.
Improve this question
I need to redirect ALL instances of example.com/privacy-policy to a new domain page.
For example, redirect example.com/privacy-policy AND example.com/subfolder/privacy-policy
This is what I have:
RedirectMatch 301 ^/privacy-policy/(.+?)(-[0-9]+)?$ https://new.example/privacy-policy/v2/
I'm not having any luck and I'm struggling with other versions of this.
What am I missing?

You can use this rule with a tweak in your regex:
RedirectMatch 301 /privacy-policy(/.*)?$ https://new.example/privacy-policy/v2/
By removing ^ from regex we are now matching /privacy-policy anywhere in URI not just the start.
Since you don't care what comes after /privacy-policy, there is no reason to match anything but optional /.* in the end.
Make sure to use a new browser for your testing.

Related

Is it possible to see "hidden" documents without knowing they exist? [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 11 months ago.
Improve this question
is it possible to see all files that are theoretically viewable by a link but not linked on the main website?
For example:
Let's say the website has:
index.html
undepage/index.html
supersecretdocument.pdf
Is it possible to see the supersecretdocument.pdf know that the document exists without knowing that it's there?
If you're asking "Can I know a file exists without trying to GET (or HEAD) it?", the answer is "no."

Design in mod_reqrite a rule from directory to file [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 try to define following rewrite rule:
The user should enter a url to a directory like: www.url.com/voucher
But the real url should be: www.url.com/voucher.php
And the user should only see the first url - never the second.
Any ideas?
Thank you.
Try with this in .htaccess after RewriteEngine on line:
RewriteRule ^voucher /voucher.php

How to view instagram profile picture in full-size? [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 5 years ago.
Improve this question
I was able to view and download a person's full sized, high resolution profile picture on Instagram until even a few days ago. I usually remove the 's150x150' from the URL and it worked fine for me. But now when I try the same thing I get a error saying 'Invalid URL signature'. I don't know what's happened. Can someone find me a solution for this problem? Or an alternate method maybe?
replace "150x150" with 720x720 and remove /vp/ from the link.it should work.
You can even set the prof. pic size to its high resolution that is '1080x1080'
replace "150x150" with 1080x1080 and remove /vp/ from the link.

samb.conf: Where is the "security" parameter? [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
I'm trying to make files in my linux virtual server browsable from my windows. I'm following the instructions given here: https://help.ubuntu.com/lts/serverguide/samba-fileserver.html
However, I cannot find the security parameter it's talking about. Can I just create that anywhere under the [global]? Or is there a pretty specific place to put it?
Yep, you can just specify the "security=" parameter anywhere in the global section.
https://www.samba.org/samba/docs/man/manpages/smb.conf.5.html

Link to a PGP/ASC-File on my website [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
I would like to include a link to a pgp key (asc-file) on my website, and if someone clicks it, I want it to open in the browser window (instead of displaying a download prompt). How can I do that? I tried the mime type mentioned on the following page, but it doesn't seem to work. http://www.bauser.com/websnob/keydist
Adding the following line to my .htaccess file seems to solve the problem.
AddType text/plain asc
It may not be the best solution, but it works for now.

Resources