Please help!
EX: I have one domain:
http://www.example.com
and then I want to generate dynamic sub domain
http://user.example.com
Thank!
Related
currently in Netlify you can create aliases of my custom domain normally, but I would like to know if i can add these alias from an API / Programmatically.
Netlify provides documentation on their api including the following:
UPDATE SITE
PATCH /api/v1/sites/{site_id} will let you update some attributes on a site
PUT /api/v1/sites/{site_id} will let you update some attributes on a site
This lets you update a site. Takes all the same parameters as when
creating a site.
When creating a site, you can set the following properties:
name, the name of the site (mysite.netlify.com)
custom_domain, the custom domain of the site (www.example.com)
password, password protect the site
force_ssl, will force SSL on the site if SSL is enabled
domain_aliases, is an array of OTHER hostnames your site has in addition to the custom domain
processing_settings, lets you set the following processing settings: {“css”: {“bundle”: true, “minify”: true}, “js”: {“bundle”: true, “minify”: true}, “html”: {“pretty_urls”: true, “canonical_urls”: true}, “images”: {“optimize”: true}}
repo, lets you configure continuous deployment. It’s a bit complicated to create a repo object so please contact support for guidance if you want to do this.
Based on this, I suspect you would be able to use their API to adjust your custom domain - however they do not make any reference to a means to adjust aliases such that you can control more than one domain at a time. You may be able to contact their support team and request assistance if that is something you require.
I'm making a web app where users can create pages, edit them, and delete them. In developing the prototype, I have a user access a route such as:
localhost:8000/mypage/1
The "1" in the URL refers to the ID in the database, so that the controller can fetch the appropriate associated data and populate the page accordingly.
The obvious problem here is that a user can plug in any number to that URL and edit someone else's page.
One obvious fix would be to add logic that checks whether or not page '1' belongs to the Auth::user(). But this would be an if statement that I have to add to every controller that carries out such function.
When I think about other sites, they never have ID's in the URL, or if they do, they look 'encrypted' in some form. What is the best practice for changing an ID into some uninterpretable string that I frequently see done on other websites?
Thank you for any help.
why don't you just use a middleware that check if the route can be acceded by the user? then you can call it with
$this->middleware('middlewareName');
in the controller that you need it or even in the web.php if you want a whole set of routes protected
I am developing a Cordova App, and I use a URL parameter to manipulate or control my pages. e.g.:
file:///App/www/index.html?goto=profile
What I am trying to do is to remove the goto parameter from the URL.
An example use case: the user login using a temporary password. When the user logged in successfully the app will point them to the "change password" page, which is represented by a parameter on the url - ?goto=profile. Now the url has this parameter.
The problem here is that two parameters are set; ?goto=profile and ?goto=messages (directed the user on his inbox page). So the url now would be file:///App/www/index.html?goto=profile?goto=messages.
How to remove the ?goto=profile in the url without reloading the page?
to add multiple search query parameters, concatenate them with an ampersand (&). e.g.:
file:///App/www/index.html?goto=profile&goto=messages
if you don't want multiple parameters (they have the same name, so i presume you only want to replace the goto parameter value), just overwrite it.
i don't know the implementation used for routing, as you did not specify it in your question, but with plain javascript, it'd be something like this:
location.search = 'goto=messages';
Does anyone know a way of getting details of DLC and Bundles from steam?
I can easily get App details with the following URL: (Borderlands 2)
http://store.steampowered.com/api/appdetails?appids=49520
This is the store page, notice the GET part of the URL is /app/{id}/
http://store.steampowered.com/app/49520/
Now I need to get the same sort of result from the API for a bundle.
This is the store page, notice the GET part of the URL is /sub/{id}/
http://store.steampowered.com/sub/32848/
I tried
http://store.steampowered.com/api/subdetails?subids=32848
and get Access Denied.
Any suggestions?
You should use package instead of sub to get the information.
You can use below link to access the package info
http://store.steampowered.com/api/packagedetails?packageids=32848
There is currently no way to get bundle info, without scraping the HTML. Only apps/packages.
I would like to create a relative link that switches the current protocol from http to https. The last place I worked had something set up on the server so that you could make that happen, but I don't remember much about it and I never knew how it worked.
The rationale for this is that I wouldn't need to hardcode server names in files that need to move in between production and development environments.
Is there a way for this to work in IIS 6.0?
Edit:
I am using .NET, but the "link" I'm creating will not be dynamically generated. If you really want the nitty gritty details, I am using a redirect macro in Umbraco that requires a URL to be passed in.
Here's a simple solution in VB.NET:
Imports System.Web.HttpContext
Public Shared Sub SetSSL(Optional ByVal bEnable As Boolean = False)
If bEnable Then
If Not Current.Request.IsSecureConnection Then
Dim strHTTPS As String = "https://www.mysite.com"
Current.Response.Clear()
Current.Response.Status = "301 Moved Permanently"
Current.Response.AddHeader("Location", strHTTPS & Current.Request.RawUrl)
Current.Response.End()
End If
Else
If Current.Request.IsSecureConnection Then
Dim strHTTP As String = "http://www.mysite.com"
Current.Response.Clear()
Current.Response.Status = "301 Moved Permanently"
Current.Response.AddHeader("Location", strHTTP & Current.Request.RawUrl)
Current.Response.End()
End If
End If
End Sub
Usage:
'Enable SSL
SetSSL(True)
'Disable SSL
SetSSL(False)
You could add this to the Page_Load of each of your pages. Or you could do something like I did and create a list of folders or pages that you want secured in your global.asax and set the SSL accordingly in the Application_BeginRequest method. And this will work with relative links and the HTTP or HTTPS status of a page will always be what you tell it to be in the code.
I have this code in place on several websites. But as an example, if you go to https://www.techinsurance.com you'll notice it automatically redirects to http because the home page doesn't need to be secured. And the reverse will happen if you try to hit a page that needs to be secured such as http://www.techinsurance.com/quote/login.aspx
You may notice that I'm using 301 (permanent) redirects. The side benefit here is that search engines will update their index based on a 301 redirect code.
Which language/framework are you using?
You should be able to create your own function in which you pass in the relative page and you deduce from the HttpRequest object and the Server object (again depending on the language or framework) what the host and URL are and then just simply redirect to that URL but with https as a prefix.
Here is a good CodeProject article on doing this by specifying certain directories and files that you want to use SSL. It will automatically switch these to and from https based on your needs.
I've use this for a project, and it works really well.
This is the same answer I gave here:
Yes you can. I recommend this free open source DLL that lets you designate which pages and folders need SSL and which don't:
http://www.codeproject.com/KB/web-security/WebPageSecurity_v2.aspx
So you can setup a page to be secure in your web.config like this:
<secureWebPages encryptedUri="www.example.com" unencryptedUri="www.example.com" mode="RemoteOnly" >
<files>
<add path="/MustBeSecure.aspx" secure="Secure" />
</files>
</secureWebPages>
We ended up buying ISAPI Rewrite to perform redirects at the web server level for certain URLs. That's not quite the answer I was looking for when I asked the question, but it's what works for us.