How to add the dot to htaccess when setting up MAMP? - .htaccess

I set up MAMP so I can set up extensionless URLs on a client site, which I've never done before. I'm using MAC OS 10.7.x. I set up the ports as 80, 7888 and 3306. I use Fetch for FTP and have show hidden files turned on. I write html but not php or any other scripting language.
I have a static HTML client site loaded into the MAMP/htdocs folder and the website is working except for the includes because I can't add the dot to the htaccess. I do this all the time on web servers.
I opened the current htaccess located in my client file (not in MAMP), with my text editor (BBedit) then tried to save it with the dot and the finder will not let me do it.
As a test, I then opened Mamp/htdocs/client and at the same time opened the active website via FTP and drug the current htaccess file with the dot into that folder. However I can't tell that it did anything. And even if it did, it would be invisible and then I couldn't edit it.
I've spent about 8 hours searching the internet for a solution to this problem, and discussing the same issue in a well known apache forum, and nobody seems to know how to do this (other than telling me to open in text editor and resave, which isn't working).
I hope someone here can steer me in the right direction.

I'm not sure if I understand your problem completely, but I know 2 ways to have more control in Mac OSX concerning file naming:
http://www.macupdate.com/app/mac/27025/secrets
This software allows you to set some hidden setting, like show all hidden files
Open a terminal and use something like:
$ sudo mv htacces .htaccess
Good luck

Use a better editor, which shows hidden files on its file browser, e.g. SublimeText 3 or go to the Finder preferences and show hidden files in general.

Related

How to make something like AdCloseGold?

I'm frequently dealing with websites that open a bunch of new tabs with ads and I'm tired of it.
A while back I discovered AdCloseGold which is a Chrome extension that automatically closes all tabs that open a specified URL and I've happily used it for a while now.
Unfortunately, AdCloseGold has a few shortcomings:
1) No wildcards in the url
2) A limited amount of urls one can ad (because it stores the data in a Google account)
3) Doesn't close blank pages or page not found.
4) Doesn't have a button or something that says "add THIS page to auto close", meaning you have to copy and paste all urls manually into the list.
5) Doesn't provide any prewritten list of urls.
Recently I've started using the hosts file, redirecting urls to a nonsense address and then close that address through AdCloseGold, meaning I need just one address to auto close, but that has quite some problems as well, because the hosts file requires the full url, i.e. adding xyz.com to the hosts file doesn't redirect abc.xyz.com.
Furthermore, I do not really want to redirect all of these urls permanently but rather only in Chrome, so I can still access those pages through Firefox or IE.
I'm a (hobby) coder and I don't mind the work, I consider it more fun than work, but I only have some rudimentary knowledge of how to make a Chrome extension.
So the question is: Does a Chrome extension like an advanced AdCloseGold already exist and if not (I couldn't find any) where would I find a detailed enough tutorial for Chrome extensions, where I could learn this?
Author of Ad Close Gold here. I'm aware of the shortcoming you mentioned in your question. I've really wanted to add those to the add-on but never really can find the time to do so. I first created the add-on just for myself and it was fine for me. I thought I'd share the add-on with everyone since, even till this day, I cannot find any add-on that will auto-close tabs for me.
I have the source code for the add-on on github: https://github.com/mukunku/Ad-Close-Gold
Feel free to fork the repository and make any changes. You can create a separate add-on or merge the code back to my project if you like. If you merge the code back to mine, I can release it as a new version (And give you credit of course).
P.S. Wild cards are technically supported. If you use a regular expression as the URL and enable the IsRegEx option, it will work.
For example: www.ali.*.com
This will match all of the following:
www.aliexpress.com
www.aliother.com
www.ali.com

permanently keep a edited website, locally

I would like to keep a copy of a website, which I have edited saved locally to my machine, but so when I type in the url it comes up as the webpage I edited. It is not my website, I don't have access to the server but I would like my own edited copy of the website. Something like greasemoneky but which is easier to setup and use but also able to be able to sync with chrome if possible.
Thanks in Advance
Add an entry in C:\Windows\System32\drivers\etc\hosts file so that the URL redirects to your own computer?
127.0.0.1 www.google.com
Then you have to have a webserver installed with the local page bound to the url.
I'm not sure what you're intending to use this for. Hopefully not anything shady.
To redirect any website url on your local machine you could set up parental controls.
There's plenty of ways to do it and it depends on your browser/operating system/modem.
You can locally redirect files via your computer's local hostfile.
http://en.wikipedia.org/wiki/Hosts_file
https://www.youtube.com/watch?v=_pTvYMCMtKU
If you really want to get serious about it, then you could set up a little local DNS hijack with a service like OpenDNS. An even more extreme option would be something like DNSMASQ http://www.thekelleys.org.uk/dnsmasq/doc.html.
After you finish editing the website,press ctrl+s and that will save a copy of the website.

Where to look in my Joomla installation for the pharmacy hack?

We've discovered today that our Joomla website has been hacked by a pharmacy trojan.
It was difficult to discover because most users don't see it when visiting our website.
One user reported about 2 weeks ago that our site contains viagra/pharmacy spam.
We've looked into it, but found nothing. The conclusion was that the users computer was infected.
Yesterday another user reported this problem, so I've started to investigate again.
One hour later I've discovered that the site is indeed infected.
When I visit this webpage with my web browser all if fine:
http://www.outertech.com/en/bookmark-manager
But, if I do a google translate of this webpage I see the infection (viagra and cialis links):
http://translate.google.com/translate?sl=en&tl=de&js=n&prev=_t&hl=de&ie=UTF-8&u=http%3A%2F%2Fwww.outertech.com%2Fen%2Fbookmark-manager
The same happens if I use curl:
curl -L -A "Googlebot/2.1 (+http://www.google.com/bot.html)" http://www.outertech.com/en/bookmark-manager
As a next step I made a backup (Akeeba) of the website and transferred it to a local xampp installation for further investigation.
The local xampp installation with the website has also the same problem, so indeed the Joomla installation is infected.
a visit of
http://localhost/en/bookmark-manager
shows no problems, but a
curl -L -A "Googlebot/2.1 (+http://www.google.com/bot.html)" http://localhost/en/bookmark-manager
contains the viagra links.
I've looked for hours at the (mostly php) files, did a lot of greps etc, but I cannot find anything suspicious.
Virus Total and Google Webmaster report the site as clean.
I did an audit on myjoomla.com, but no malware was found.
I would be really grateful if someone could point me in the right direction.
Where to look inside my Joomla installation for this hack?
I've restored an older backup that was not infected to a local Xampp installation. Did a backup of the current site and installed into to another local Xampp instanced. Made a diff of all files between the two installations and found the hack in the application.php file (it was only one line). Removed the line and the hack died. I still don't know how the site got infected (all addons are the latest versions). I've changed the password as a security measure and monitoring for this hack once a week.
edit: myJoomla.com report did actually find the hack, I didn't read the report carefully enough.
We recently recovered and migrated a Joomla 1.5 site to 2.5 and the hack was found in the template files (index.php and various override files in the templates html/ directory).
The surprising thing was we also found that about 1 in 10 of the articles had been infected. i.e. when we searched the jos_content table we found the fulltext column had Javascript embedded in it. So, I would suggest also looking there.
Your best bet is to use a tool like myJoomla as it was specifically created for this sort of thing for Joomla.
I also had this problem where if I'm visiting a sub page, the home page would load instead and show a lot of Pharmacy gibberish. But this only happened when I had Firefox Firebug opened. It turned out in my template under /html there was a mysql.php file that shouldn't be there. Luckily, I created this template so I deleted the template on the server and uploaded my original version and the problem went away. Hope this helps.

In drupal Primary Link is like empty

I'm making a webpage in Drupal 6.26, and I blocked in a strange thing. I develop both in Localhost, and online, and the strange is that some how in online the primary links are empty (but there's element on it I can see in /admin/build/menu-customize/primary-links also in this page the menu elements appeared in the place, but in the other pages they don't), but in Localhost everything is ok, and i checked all of the settings and they are the same, the theme files are the same to,(and i didn't change anything in the other drupal files), the only difference is that the online page is set in offline (because the under maintenance), and I tried it to make it online, but the problem is still there, so I don't really have any idea.
That might be a theme problem. Make sure your local configuration has the same active theme as the installation on the public server. Try switching to a default theme that comes with Drupal.
Another cause might be one of your modules. Try disabling all but the system modules and then start re-enabling them one-by-one to see which one changes your menu.

Launch local folder from XPSP2+ / IE8

We've got an intranet which normally serves all info/documents that appl to the whiole company (employee handbooks, minutes, etc...)
Most of these work by having the web server parse a folder and present the files to the user.
The problem in this case is that the latest folder is restricted to cerain users. As Kerberos is not currently an option, I was planning to side-step the issue and just insert a link which opens up a UNC path:
file://\Server\SecureFolder\
I've just found out that since XPSP2 this hasn't been possible with standard HTML/JS.
Does anyone know of a nother way this can be done? It's internal so I've got a lot of control over the webserver (but domain config changes will have to be justified)
I'm wondering if there's something like .Net or an ActiveX [shudder] solution or similar?
Thanks in advance for any help.
Seems the solution was to do it without Javascript and without the file://
The following works:
Link

Resources