.htaccess

What are the .htaccess elements REQUEST_FILENAME and THE_REQUEST?

独自空忆成欢 提交于 2021-02-18 20:04:24
问题 What is returned by %{REQUEST_FILENAME} and %{THE_REQUEST}? I was just checking over our .htaccess file and it dawned on me, I have very little knowledge of this. The code below uses both. It works I just want understand it. #remove / at the end of URL RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+)/$ /$1 [L,R=301] #remove /index.php at the end of URL RewriteCond %{THE_REQUEST} ^.*/index.php RewriteRule ^(.*)index.php$ /$1 [R=301,L] Cheers, Mark 回答1:

ddev / TYPO3 / .htaccess - redirect all http -> https

一曲冷凌霜 提交于 2021-02-18 19:43:34
问题 I need help pls understanding ddev/apache and redirects T3 site config.yaml base: 'https://sample-project.ddev.site/' ddev config.yaml name: sample-project webserver_type: apache-fpm router_http_port: "80" router_https_port: "443" use_dns_when_possible: true that works fine when calling in safari https://sample-project.ddev.site/ but when calling in safari sample-project.ddev.site it does not work I get an T3 oops so I have inserted in .htaccess (equivalent to my hosting server) RewriteCond %

ddev / TYPO3 / .htaccess - redirect all http -> https

匆匆过客 提交于 2021-02-18 19:42:35
问题 I need help pls understanding ddev/apache and redirects T3 site config.yaml base: 'https://sample-project.ddev.site/' ddev config.yaml name: sample-project webserver_type: apache-fpm router_http_port: "80" router_https_port: "443" use_dns_when_possible: true that works fine when calling in safari https://sample-project.ddev.site/ but when calling in safari sample-project.ddev.site it does not work I get an T3 oops so I have inserted in .htaccess (equivalent to my hosting server) RewriteCond %

Apache 2.4 + FPM + Wordpress Multisite: URL Rewrite not working in admin

那年仲夏 提交于 2021-02-18 19:19:52
问题 I just moved a Wordpress multi-site from a Apache 2.4 Prefork + mod_php to a new server with Apache 2.4 Event + php-fpm. The site is working well on the frontend and it is a lot faster then before due to the CGI, but... the Wordpress administration panel is working just for the main site (and network administration). The admin area for the second site is no more working, but the frontend is working great. Examples http://www.example.com/en/wp-admin/ => works http://www.example.com/en/wp-admin

Access FTP via HTTP?

蹲街弑〆低调 提交于 2021-02-18 12:55:59
问题 We have an external secure FTP server that we want to access through HTTPS (our infrastructure does not support FTPs). I know that's possible but I don't know how. I'm looking for something like this: ftp://ftp.mozilla.org/pub/mozilla.org/zz http://ftp.mozilla.org/pub/mozilla.org/zz Thanks! 回答1: To add some clarification: FTP and HTTP are, as SLaks said, two entirely different things. The links you have posted use two separate protocols. One if ftp, and one is http. You appear to be getting

Access FTP via HTTP?

那年仲夏 提交于 2021-02-18 12:55:14
问题 We have an external secure FTP server that we want to access through HTTPS (our infrastructure does not support FTPs). I know that's possible but I don't know how. I'm looking for something like this: ftp://ftp.mozilla.org/pub/mozilla.org/zz http://ftp.mozilla.org/pub/mozilla.org/zz Thanks! 回答1: To add some clarification: FTP and HTTP are, as SLaks said, two entirely different things. The links you have posted use two separate protocols. One if ftp, and one is http. You appear to be getting

htaccess: Allow from domain name instead of IP/subnet

一曲冷凌霜 提交于 2021-02-18 08:42:08
问题 On my Authentication page i have it only allow from certain IPs. Is it possible to have it allow by a domain name? The IP of my home network is dynamic but the domain name (mysite.com) always points to the correct IP address. 回答1: Yes you can. Your .htacces would look like order deny,allow deny from all allow from mysite.com 回答2: I came across this because I had the same problem. Just in case anyone else finds this, I found the perfect solution: Beginning in Apache 2.4.19, you can use the

redirect wordpress child pages to their parent page

久未见 提交于 2021-02-11 18:03:10
问题 I have a glossary page in my site with child pages like this: http://my-domain.com/glossay/a/ http://my-domain.com/glossay/b/ http://my-domain.com/glossay/c/ ... & every item in glossary has it's own child page based on alphabet like this: http://my-domain.com/glossay/a/abandon/ http://my-domain.com/glossay/a/art/ http://my-domain.com/glossay/b/bee/ ... I need a redirection rule to redirect users from items child page, to their parent page based on their first word. for example: http://my

Remove folder name from URL

安稳与你 提交于 2021-02-11 18:02:17
问题 I have a domain www.domain.com redirected to / in my server. Next I have index.php whith code: header("Location: http://domain.com/v3/"); When I enter mydomain.com I have mydomain.com/v3/ in url. How to remove v3 from Url 回答1: Remove header line from your PHP code since it is doing a redirect and have this lookahead based rule in your root .htaccess : RewriteEngine On RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+v3/([^?\s]*) [NC] RewriteRule ^ /%1 [R=302,L,NE] RewriteRule ^((?!v3/).*)$ /v3/$1 [L

301 Redirect .mp4 file to a link

戏子无情 提交于 2021-02-11 17:25:38
问题 I have a link to a video file (example.com/abc.mp4), which, when clicked, I would like to redirect to another link. We don't want to change the link on the page since this link was given out, so it would make more sense to redirect it, if possible. I would think there should be a way to do this via .htaccess and RegEx, but have not been able to have any luck finding a solution, or talk about something like this. Does anyone have any ideas? 回答1: There are two chances: either you're doing the