Hello,
on my local computer I have a repo with php-code like this:
Because for local development and testing I have a local web server which points to the root-folder I can easily access my index.php without the htaccess-check.
But on my online-server (for other users) I want to have a result like this:
My question: How can I do this with Bitbucket Pipeline?
I need ideas please how to move the 2 files from the sub-folder to root-directory during the build process.
The upload via FTP is already running... here a part from my bitbucket-pipelines.yml:
- pipe: atlassian/ftp-deploy:0.3.7
variables:
USER: $FTP_USER
SERVER: ftp.strato.de
REMOTE_PATH: /
PASSWORD: $FTP_PASSWORD
If you have better ideas instead of atlassian/ftp-deploy I'm open for ideas too :-)
PS: SFTP is not running with Strato... For ssh.strato.de there was this error message coming up > but FTP was working:
Many thanks :-)
Michael
Update
I found another solution with .htaccess which I want to share with you.
In my repo I work now with this:
And I updated the .htaccess by a host-check... Which is possible in Apache...
<If "req('Host') == 'domain-xyz.com'">
AuthName "Prompt"
AuthType Basic
AuthUserFile /home/htdocs/domain-xyz.com/.htpasswd
Require valid-user
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]
</If>
<Else>
Require all granted
</Else>
So now the htaccess-protection is only used on my online server (host = domain-xyz.com), but not on my local dev environment.
BUT: I'm interested in a solution for my question too :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.