Since upgrading to iOS 7, my iPhone could no longer access my Baikal Card DAV server. On the project's GitHub page, there are several issues open regarding this issue, but none could help me getting my iPhone talk to the server. How can I make this work?
The important thing is to add these lines to your .htaccess
RewriteEngine On
# iOS 7 (and later)
RewriteRule /.well-known/carddav /card.php [R,L]
RewriteRule /.well-known/caldav /cal.php [R,L]
# Mac OS X 10.10
Redirect /.well-known/carddav /card.php
You then setup the Cal DAV as described in the installation instructions. For Card DAV make sure to follow these steps.
Server your.server.url (without http[s]-prefixes)
User name and password
Make sure the Account URL in the advanced settings looks like this: https://your.server.url/card.php/principals/username
I used the Flat File method via FTP and no .well-known directory is made. Therefore, I removed .well-known and made it work with:
RewriteRule /carddav /card.php [R,L]
RewriteRule /caldav /cal.php [R,L]
This is also above the rule:
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
I am running my web server via a different port as well. Thanks for your config, just a little tweaking was required to make life good.
iPhone 5S IOS 7.0.4
Baikal FLAT FILE 0.2.7
Synology NAS 412+ DSM 4.3-3827
Related
I'm using :
TYPO3 6.2
I want to add more security and restrict access to our website backend only to our IP range. Problem : I believe my company use a proxy and :
getenv:HTTP_HOST -> the same for everyone
But if I display in typoscript :
getenv:HTTP_X_FORWARDED_FOR -> then the real IP appears !
But the parameter [BE][IPmaskList] only cares about the HTTP_HOST, not the FORWARDED FOR. How to solve my issue ?
I also tried with .htaccess in the /typo3/ folder, but it doesn't work :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP:X-FORWARDED-FOR} !^10$
RewriteRule ^$ http://www.mycompany.com [R=301,L]
</IfModule>
(btw mod_rewrite is working fine, I use it in the parent htaccess for url rewriting). My goal is to deny backend from all except if HTTP:X-FORWARDED-FOR begins with 10.x.x.x
I would restrict it with a htaccess file. However if you care about security you should consider an update to latest version 8.7 as 6.2 is already end of life! You can also buy an extended support from the typo3 GmbH at typo3.com
according to:
https://github.com/TYPO3/typo3/blob/TYPO3_6-2/typo3/sysext/backend/Classes/FrontendBackendUserAuthentication.php#L187
and:
https://github.com/TYPO3/typo3/blob/TYPO3_6-2/typo3/sysext/core/Classes/Utility/GeneralUtility.php#L3468
IPmaskList has nothing to do with HTTP_HOST.
Maybe your TYPO3 is running behind a reverse proxy,
then you need to set "reverseProxyIP" and "reverseProxyHeaderMultiValue" properly.
Is it not possible in Mamp Pro 4 to have both http and https? The application I am working on requires both depending on the page.
I must be missing something as it makes no sense when I enable SSL only https works and http then stops working.
I tried going through the http.conf, but really have no idea whats causing this.
I think it just generates the vhost for https only and then removes http. Doesn't even look like you can manually edit it.
Any suggestion would be great.
Well to update my own post and if anyone else has this problem.
The software is currently not capable of this on the same hostname.
According to Mamp support you have to create two hosts with the same name (e.g. sample.app and sample.app.).
Enable one of the "sample.app" hostnames to use SSL
Enable the second host entry "sample.app" to not use SSL. (Don't forget to hold Alt or Option when clicking on +)
Point both to the same directory.
Mamp will highlight this in red, as its warning that you have two of the same hostnames.
So currently this is the only solution I am aware of for this issue.
Hope they resolve this in future updates as a lot of applications, especially ecommerce rely on the ability to switch between http and https.
You can see this on the Mamp Pro documentation here.
I got a simple solution by edit template:
Open Mamp Pro
File > Edit Template > Apache > httpd-ssl.conf
Add these line after
<VirtualHost *:80>
ServerName MAMP_SSLVirtualHost_ServerName_MAMP
MAMP_SSLVirtualHost_ServerAdmin_MAMP
MAMP_SSLVirtualHost_DirectoryIndex_MAMP
DocumentRoot MAMP_SSLVirtualHost_DocumentRoot_MAMP
</VirtualHost>
Mamp Pro 5 in 2020 Update
To tag onto MrDuy's great response, as the Alt Click on the + doesn't seem to work in V5, editing the httpd-ssl.conf template seems to be the way to go.
However MrDuy's answer assumes you're using port 80 for HTTP inside MAMP, which is not the default 8888. Additionally, and I can't speak for MAMP PRO 4 users, the snippet needs to be placed before the MAMP_SSLVirtualHost_iteration_end_MAMP line at the bottom of the file, as obviously this is the end marker that MAMP uses to conduct its iteration of the hosts in the GUI.
TLDR;
Follow the first two steps in MrDuy's answer:
Open MAMP Pro
File > Edit Template > Apache > httpd-ssl.conf
Then, at the bottom of the file, locate the line with MAMP_SSLVirtualHost_iteration_end_MAMP Before this line, paste the following:
<VirtualHost *:8888>
ServerName MAMP_SSLVirtualHost_ServerName_MAMP
MAMP_SSLVirtualHost_ServerAdmin_MAMP
MAMP_SSLVirtualHost_DirectoryIndex_MAMP
DocumentRoot MAMP_SSLVirtualHost_DocumentRoot_MAMP
</VirtualHost>
It would've been niced to use the placeholder markers MAMP uses in it's non SSL config file (MAMP_VirtualHost_IP_MAMP, MAMP_VirtualHost_Port_MAMP etc) but obviously these aren't passed in the file. Which means that if you decide to change the HTTP port, you must also manually update this file.
#MAMP, can't we make this a default? :`(
Cheers!
I am somewhat new to Laravel, and recently I got a setup at work to function exactly as I wanted. I have a single installation of Laravel with a subdirectory of apps that all use that same backend as a RESTful master.
The issue I'm having is that when I'm home, I've cloned this repo and changed the db settings to match my localhost at home (instead of at work). However, each time I try to load a rout for a resource I get 404'd!
Here's some code.
app/routes.php:
Route::get('/', function()
{
return 'fgh';
});
Route::any('config', function() {
return 'GET config';
});
//Main Rest Controller
Route::resource('main', 'MainController');
// Route::resource('config', 'ConfigController');
Route::resource('data', 'DataController');
The folder structure is:
|-- appREST (where Laravel is)
|-- shared
|-- apps (where the apps are)
What I am trying to do (which I do at work) is simply make an AJAX call from an app in the apps/ directory, but to a relative path that is adjusted for where appREST is.
At work, I AJAX to '../../../appREST/public/config', or ../public/main or whatever. However, for some reason, this fails at home. The same tables exist in both databases at work, and both are up and functioning (no one else has issues on either). It seems almost as if some local Apache or other setting on just my machine is failing?
I can load the first route for REST (Route::get('/')) in the browser, and 'fgh' IS displayed. However, even after changing to GET config and a string any call either AJAX or browser to any route but '/' 404s.
Also, as a note, in the meantime the applications themselves work fine. If I load static/hard data instead of what I'm trying to load, there are zero problems. This appears to be isolated to my routing in Laravel/Apache.
EDIT
I forgot to include the HTACCESS file for the /appREST/public folder. Here it is:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
NOTE
The setup is a git repo and I actually have this on two separate machines. On the original machine, where the repo starrted as a working directory, the above code works fine. It is only on my home, clonedTo machine that the routes fail.
Does anyone have any ideas or suggestions?
Thank you!
The only way I eventually fixed this was a clean reinstall of both XAMPP and Laravel.
Given that I could find the '/' route and the errors were 404s, I'm going to tentatively call this an Apache error.
So, for anyone else having this issue: I suggest you check your XAMPP/web server settings if your Laravel routes 404!
I have DNS managed by NO-IP and self hosted websites on a QNAP, with Virtual hosts defined in the Qnap Software.
My sites are www.site1.com, www.site2.com and a new www.site3.com which (this one will work with subdomains created by wildcards at Users input in Joomla) (ex user1.site3.com would be the redirection of the site3.com/index.php/users/user1) and all are located in (root) web_folder/site1/...site2/...site3/ . The other sites have their virtual hosts working right.
Now, before doing that, i am getting stuck on this Qnap issue where i can't define my wildcard dns *.site3.com in the virtual hosts. I want to do this because when i enter in the browser anything.site3.com it gets me to the index.html file located in the root folder of my published sites (web/index.html)
What shoud I try in order for the subdomains to pass the root index and go directly to the website folder, where i could place my .htaccess containing the rewrite rules?
I tried with a .htaccess but couldn't manage what to write in order for it to work.
Define the wildcard in the qnap virtual host but does not accept
What am i thinking wrong?
I would like to avoid having a .htacces, in the web folder, to redirect every domain/subdomain to it's respective subfolder and afterwards having another .htaccess insinde my site3 folder which does the rest of the rewrites (subdomains wildcard and user based)
I have managed to do so far:
I shall partially answer to my question
RewriteEngine On
Options +FollowSymlinks
RewriteCond %{HTTP_HOST} !^www\.site3\.com<br>
RewriteCond %{HTTP_HOST} !^static\.site3\.com<br>
RewriteCond %{HTTP_HOST} ^(www\.)?(.+)\.site3.com$ [NC]
RewriteRule ^(.*)$ http://site3.com/index.php/user/%2 [L]
The thing is, I would like to still see user.site3.com instead of the full link.
As an update. I am running wordpress multisite. My www.site3.com comes into the qnap(web or public_html folder) then the NAS virtual host manager redirects it to its actual subfolder (site3).
In this situation, when i write :
-anything.site3.com it reads my top (web or public_html) index and i can't get to the wordpress subpages. (my anything.site3.com page has been created from user-end)
-site3.com it goes to mi site3 folder as it should, managed by the qnap virtual host (i don't have to write additional htaccess.
So i need to somehow let my subdomains pass the redirection from the qnap and go to my site3 subfolder and then wordpress htaccess do it's job. This should be done so that i don't have a continuous loop!
Sorry for my explanations might be a little bit messed.
I have a domain... let's say www.myOldDomain.com. It is currently running a site about local services near you.
I got a new domain (www.myNewDomain.com), it is also going to run a site about local services near you (albeit in a slightly different way). In fact, I want to totally replace www.myOldDomain.com with www.myNewDomain.com - on the same host using the same hosting account ( I don't want to pay for 2 accounts).
I want ANY traffic to www.myOldDomain.com/* to be redirected to www.myNewDomain.com/WelcomeOldDomainers
How would I go about doing that? Would I do it programmatically, or at DNS?
Update: This is on a Windows host.
Linux Hosting
The best way is using a .htaccess file at the root of your website directory if you are under linux hosting :
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.myOldDomain\.com/$1 [NC]
RewriteRule ^(.*)$ http://www.myNewDomain.com/$1 [R=301,L]
Beware though : this assumes the $1 part of your old domain is the same than your $1 of your new domain. And from reading your post I'm not sure this is the case.
.htaccess allows you to configure that in a very flexible way though.
Look on google for "URL Rewriting" and "htaccess redirection"
Windows Hosting :
You can use the web.config file from your IIS 7 or superior :
http://learn.iis.net/page.aspx/557/translate-htaccess-content-to-iis-webconfig/
Beware though Bis : Be careful not to leave old pages SEO goes to waste and be sure to map the best you can old pages to new pages or you'll loose all the SEO juice you have been building for these old pages.
The best option is to send a HTTP/1.1 301 Moved Permanently
In ASP.NET you would set Response.Redirect("www.myNewDomain.com/WelcomeOldDomainers")
in global.aspx