configure only allow specific domains to access certain folders using .htaccess

I am having a scenario as following:

For example,I have a website http://www.example.com, and I have setup a few subdomains such as http://video.example.com, http://image1.example.com, http://image2.example.com. In Apache virtual host setting, they are using the same folder (e.g. /home/example/). (these two domains have different bandwidth setup using mod_cband).

I have a subfolders /home/example/files/videos, I want to make it only accessible from the subdomain http://video.example.com/files/videos/ but not from http://www.example.com/files/videos/ or any other subdomains.

How shall I configure this with a .htaccess file?

enable xdebug on bluehost shared server

I want to setup phpunit on a demo site on a bluehost shared server. I want to check if the php codes work on the environment after I made modifications and added more components. With this, I need to set up xdebug. The problem is that my account is not allowed to download and install xdebug, I got permission denied.

pecl install xdebug

Then I read upon an answer here Xdebug for remote server not connecting. What I did is upload the xdebug.so file from my local, copy the /etc/php.ini to the server's public_html directory, and edited the php.ini file and and added the line below to refer to the xdebug.so file on the server.

zend_extension=/home1/user/public_html/xdebug.so

But after what I did, the phpinfo state that the xdebug is not enabled. Bluehost does not require to restart the apache. So it will refresh itself as I understand it. And the phpinfo state that the loaded ini file is the one on my public_html directory now. Is this possible to enable xdebug this way? Are there other ways to install/enable on bluehost shared server?

Htaccess Not Working – Redirect 301

Due to some bad URLs, we generated some links that don't work and I want to redirect them with a 301 redirect to clear up some webmaster tools issues with Google.

So, we have this URL like this:

http://www.site.com/subdomain/z//-products

*Note that subdomain is variable, the rest of the url is static.

As a side note, this URL makes no sense, that's why I want to redirect it. It should be something like this:

http://www.site.com/bedroom/z/12345/bedroom-furniture-products

Anyway, we had these bad URLs being dynamically generated. We've fixed them, but google picked them up and keeps trying to crawl them. I want to create an htaccess rule to 301 redirect them and the issue should wash out eventually.

Here's what I tried with htaccess to no avail:

^(.*)/n//-products/?$ $1 [R=301,B]

I've also tried all kinds of permutations of this and it's not working. I suspected it was an entity escaping issue, but my research led me to add the [B], but that didn't seem to work either. It's like the redirect rule is working, but it's just redirecting to the original page.

What am i missing here?

htaccess show shorten url

I am using .htaccess to shorten a long url to a shorter nice looking url like

www.dom.com/trol to http://www.newdom.com/blog.php?type=user&user=trol

It works fine. But it the browser it shows the long url. How can I show the short url in the browser addres field?

I am using:

RewriteCond %{HTTP_HOST} ^dom\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.dom\.com$ 
RewriteRule ^(.*)$ http://www.newdom.com/blog.php?type=user&user=$1 [NC]

htaccess show shorten url

I am using .htaccess to shorten a long url to a shorter nice looking url like

www.dom.com/trol to http://www.newdom.com/blog.php?type=user&user=trol

It works fine. But it the browser it shows the long url. How can I show the short url in the browser addres field?

I am using:

RewriteCond %{HTTP_HOST} ^dom\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.dom\.com$ 
RewriteRule ^(.*)$ http://www.newdom.com/blog.php?type=user&user=$1 [NC]

htaccess show shorten url

I am using .htaccess to shorten a long url to a shorter nice looking url like

www.dom.com/trol to http://www.newdom.com/blog.php?type=user&user=trol

It works fine. But it the browser it shows the long url. How can I show the short url in the browser addres field?

I am using:

RewriteCond %{HTTP_HOST} ^dom\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.dom\.com$ 
RewriteRule ^(.*)$ http://www.newdom.com/blog.php?type=user&user=$1 [NC]

htaccess show shorten url

I am using .htaccess to shorten a long url to a shorter nice looking url like

www.dom.com/trol to http://www.newdom.com/blog.php?type=user&user=trol

It works fine. But it the browser it shows the long url. How can I show the short url in the browser addres field?

I am using:

RewriteCond %{HTTP_HOST} ^dom\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.dom\.com$ 
RewriteRule ^(.*)$ http://www.newdom.com/blog.php?type=user&user=$1 [NC]

How to get back Lost phpMyAdmin Password, XAMPP

I have a local host running on XAMPP on a Mac. At some point I set a password in phpMyAdmin which I've ow forgotten. Can anyone help me get back into phpMyAdmin? I've followed a ton of tutorials but they all either don't work or refer to some file that doesn't seem to be on my computer. Is there an easy way?

When I try to open:

http://localhost 

I get:

The Server http://localhost:80 requires a username and password