How to make url like username.example.com - laravel-5

I searched a lot about this topics. Maybe I wasn't in the right way or proper way.
So my question is: how I can change url from example.com/username to username.example.com?
Can I do this using Laravel?

Basically you have to create a subdomain first - username.example.com.
Now to point username.example.com to example.com/username you have two options -
configure virtual host (can be done at web server - see this for apache server)
or
Some DNS servers give you an iframe. Basically this means that for any domain name (like username.example.com) they will give you an iframe, and you can configure the iframe to point to example.com/username. This configuration will have to be done at DNS server's portal.
Use only one of the above mentioned options, I would recommend option 1 over
option 2.
Also see the following related question -
Show other domain using DNS instead of iframe

Related

Microstrategy: Loading Dynamic Images

I was using Microstrategy web and looking for a solution to change the images dynamically as per the data selected/filtered. E.g. I created a document and have tried to link photos available on a shared path. Now what I want to do is if the user id is filtered from the data, I want to show the image of user along with the relevant user data. Kindly advise if it can be achieved in Microstrategy.
TIA
Yes, I fixed it by adding the custom unique URLs which can be done hosting a normal http server i.e. using python python -m http. server port. Some other available http servers like WAMP/LAMP can also be used for this purpose.

Domino Xpages with Reverse Proxy

I have a problem with Domino Web Server with an XPages Application which is placed behind some reverse proxy. The problem is, the proxy forwards all requests from the URL like h2tps://organization/test_server/ to the Domino Web Server.
This makes all links in the application brocken. And I don't know how to fix it.
For example, the login attempt will be redirected by the server to h2tps://organization/names.nsf?Login instead of h2tps://organization/test_server/names.nsf?Login
Have you any idea how to fix it?
When using a reverse proxy, we recommend keeping the original URL unchanged. Because many redirects, Ajax requests, cookie are closely related to URL, if the URL changes, almost must go to modify the code.
This problem is especially serious in Domino, because in a lot of Javascript code that will be used in the absolute path, for example /names.nsf. As a comparison of Java applications in general will use relative paths (for example ../login).
The actual way to achieve URL unchanged: map the domain name of the original domino server (for example test.domino.xxx), to the reverse proxy server, and reverse proxy server via http HOST header to determine forwarded to which backend server, without the need to add additional path (for example test_server).
In IBM WebSeal example, this configuration is called virtual host junctions.
Did you create a site document on the domino Server?
I have solved the problem with some efforts.
At first I have moved the DB in the folder /test_server/.
Then I have changed all static HTML links to use the /test_server/.
With the option xsp.application.context.proxy=test_server I have changed the
paths for internal XPages and Extensions Library resources.
At the end I have to add some substitution rules on the Domino
to prevent duplicated paths like /test_server/test_server/.
Now it seems to be working well.
The proposal from the proxy team was to use url rewrite on the Web Server. It can be done with Domino without doubt, but requires to develop a DNSAPI Addon (a dll written in C). And it doesn't look for me like an easy task.
Anyway, thanks a lot for your help!

Joomla - filter content by IP addresses (intranet / extranet)

we are developing site (unfortunately on Joomla), where we need to restrict access to some content - articles (and also categories if possible).
Ideally, this content should be hidden even from menu. It will be enough if we were able to specify three access levels for our articles:
public visibility
visible only for intranet
visible only for extranet
Unfortunately we found no extension that could meet our requirements.
Do you have any suggestions, where we should implement this IP filter (detect IP address and check if it is from intranet or extranet is simple task, but we are quite new to Joomla API).
Approach 1 would be a System plugin, as #Lodder suggested. It would pick $_SERVER['REMOTE_ADDR'] (check this, as if you're behind a proxy, another variable might need checking - like X-FORWARDED-FOR or another). Then you can check it vs. conditions set for the article or category — yet to decide how exactly you would mark a particular article as 'Intranet only'. In case of 'access denied' just redirect visitors to the home page. All articles would be open to all by default, and can be market either 'intranet' or 'extranet'.
Approach 2 would be to have two sites instead of one, sharing same database. They can use individual template files, picking different module positions to place menus. Thus there will be two sets of menus in the system: one for Intranet, one for Extranet. Of course in this case anyone with a correct link would be able to access any article, no matter what IP he comes from. So its just a decoration.

How to open a test page with a url with a certain domain in path without deploying it to a server?

This seems like a simple question, but I just can't seem to wrap my head around it...
I have a simple html page. All that html page does is looks to see whether a browser cookie is present, and if it is, it will write a message that says "Found the cookie".
In order for this html page to work, it needs to be opened in a browser using a url that uses a specific domain "mytestsite.org" in the path in order to work. So I want to be able to open that page in a browser using a url like "www.mytestsite.org/mytestpage.html". Easy enough...
When I use this test page locally, I just deploy it to a local JBoss server, then make a mapping in my "hosts" file (I'm on Windows XP), that maps my local IP to "local.mytestsite.org". This tricks the browser into thinking that it is actually getting the page from "mytestsite.org", when it is actually being served by my local JBoss server.
I want to give this html file to another person who is going to use it on their pc. However, they don't have any sort of http server installed, so the little host mapping trick won't work. I don't want to make them go through the trouble of installing a server just to get this test page to work. Additionally, I can't physically put this file on "mytestsite.org".
Any thoughts on how I could open this page through a "mytestsite.org" url through a browser, without actually having it deployed to a server?
Is your test machine with JBoss installed accessible from the Internet? If so, you may ask the other person to add a mapping to their hosts file, that maps local.mytextsite.org to the public IP of your test machine.

How to filter myself out of Google Analytics with a dynamic IP address?

Does anyone know how to setup Google Analytics to filter yourself out if you're visiting the site from a dynamic IP address? I don't want to include myself in my stats from home use where I have a dynamic IP address via Verizon FiOS.
Google currently has a browser add-on that will block any visits of yours from showing up in any Analytics. http://tools.google.com/dlpage/gaoptout
Pluses and minuses of this opt-out versus filters are discussed in this blog post.
There are a couple ways of doing this. If you know the range of IP addresses you're accessing your site from (and don't mind filtering them all out) you can set up an "Exclude" filter for that range of IP addresses. If that's too restrictive, you can set a cookie using the Google Analytics code and filter on that. Both techniques are documented at Google's help system.
Alternatively, if you're dynamically producing the pages on the server, you could simply not write the Google Analytics code into the pages in the first place, based on the currently logged in user. On my site, I'm choosing to write the code or not based on a few things, such as whether the website is running in debug mode or if an administrator is logged on.
You can do this by creating a special page on your site that sets a Google Analytics segmentation cookie, using code something like:
<body onLoad="javascript:__utmSetVar('exclude_from_report')">
Then create a custom filter in Analytics to exclude visitors that match the 'exclude_from_report' segment pattern.
Consider using the NoScript plugin for Firefox. Just mark google-analytics.com as an untrusted site and you should be all set. A nice side-benefit: better security in your browser.
Just block the domain where google analytics lives via your system's hosts file:
127.0.0.1 www.google-analytics.com
This is less disruptive than the NoScript plugin mentioned by jdigital, but still makes you effectively invisible to google analytics.
Setting a cookie to prevent the analytics code from being sent to the browser is by far the best option.
If you're a developer and concerned that you're going to get a bazillion hits while you're developing the site you can add the following line in your analytics tracking code :
pageTracker._setDomainName(".yourwebsitename.com");
Assuming you're hitting a url not ending in .yourwebsitename.com during testing then the tracking code will see your URL is 'localhost' and not 'yourwebsitename.com' and not send any tracking.
You can always setup a proxy to tunnel all of your traffic through. Then simply exclude the proxy's IP from the results.
can't find a way to reply to answers, I second to the hosts file trick:
127.0.0.1 www.google-analytics.com
as it works in all browsers at the same time, as designers often try site in all browsers.
I recommend to use a 127.0.0.1 (localhost) redirect in the HOST file to block all/any type of abusive sites or domain/trackers/analytic and such. For a large list take a look at the WinHelp website. I have and still use it for all my PC's. You also need to look over the list which domains you do want and remark the lines with a # tag in the list.
All instructions are on the site for different operating systems.

Resources