How to use htaccess to point to a different directory?

Let’s learn how to use htaccess to point to a different directory. The most accurate or helpful solution is served by Stack Overflow.

There are ten answers to this question.

Best solution

How can i use .htaccess to point to a directory different from the one on the url bar

am stuck trying to use .htaccess to point to the template directory for users of my site. the directory where user is directed after login is mysite.com/lu/user1/ whereas the content i want to load is at mysite.com/lu/default/ what i want to achieve is load content from the default template directory so that i can modify the page when necessary and it will reflect on all user accounts pages. this whole thing is to say: when a user is in mysite.com/lu/user1/ let content from mysite.com/lu/default...

Answer:

You can use this .htaccess inside /lu/ directory: RewriteEngine On RewriteBase /lu/ # block direct access...

Read more

slb at Stack Overflow Mark as irrelevant Undo

Other solutions

How to create a database for program to use in MySQL?

Hi I'm trying to run a PHP chat bot called Program E. The installation instructions asks me to "Create a database for the program to use in MySQL". I have PHP5, MySQL, Apache2 on Ubuntu 8.10. My question is, how do I actually create a database...

Answer:

Write mysqladmin in a dos window followed by the database name you want to create C:\>mysqladmin...

Read more

apple guava at Yahoo! Answers Mark as irrelevant Undo

Restricting domains from web directory

I have my site hosted on a hosting company's servers. I have a directory in that site, let's call it www.mysite.com/safe/notsafe/ I'd like to restrict access to the "notsafe" directory. Ideally, I'd like to only permit web access if the requesting...

Answer:

Hi jhabley-ga, Good day and thanks for your question. To answer (a), you can use htaccess to restrict...

Read more

jhabley-ga at Google Answers Mark as irrelevant Undo

Can you help me with .htaccess

Help with modifying an .htaccess file. I'm on Dreamhost and using Expression Engine, if that makes any diff. Disclaimer: I know nothing of the .htaccess thingy and have never touched it before. Please explain as if speaking to an idiot! I use the Expression...

Answer:

www.mydomain.com/index.php/template/ According to this page in the EE wiki, I can configure .htaccess...

Read more

You Should See the Other Guy at Ask.Metafilter.Com Mark as irrelevant Undo

htaccess multi-domain redirect issues

I have .htaccess rewrite/redirect problems. What makes this more frustrating is that it is such a simple situation. I am doing a favour for a friend, the kind of favour that you soon wish you'd never got involved with and left for a professional to sort...

Answer:

If you just want to match the root only, then you want RewriteRule ^$ en/ [R]. You don't even need the...

Read more

The Discredited Ape at Ask.Metafilter.Com Mark as irrelevant Undo

PHP and htaccess question

I use .htaccess files to allow users access to files in certain directories based on their IP addresses/ranges. They are linked to these file from a page (not within the htaccess protected directory) generated in PHP. Is there a way to display a variable...

Answer:

Yes, but you don't want to do that, you would have to write an htaccess file parser. Instead, vave your...

Read more

chillmost at Ask.Metafilter.Com Mark as irrelevant Undo

HT set up home wireless network with laptop using active directory at work?

HT set up home wireless network with laptop using active directory at work? I'm almost certain this question has been asked before, but I can't find it. I would like to set up a home network with the following hardware/characteristics: One XP Pro laptop...

Answer:

Wow. You're asking a lot. Typical AD security settings (default) allow for 10 cached logins. So, provided...

Read more

mdion at Ask.Metafilter.Com Mark as irrelevant Undo

Complex htaccess question for Blogger to WordPress migration

I recently shifted the content management for my blog (www.sindark.com) from Blogger to WordPress. I shifted the Blogger version into a sub-directory, so that people who prefer to access old posts in that format can. Now, I want to use htaccess to automatically...

Answer:

The thing I notice immediately is that the caret should be at the begining of the rule. In RewriteRule...

Read more

sindark at Ask.Metafilter.Com Mark as irrelevant Undo

How can I use .htaccess to shorten URLs?

I need some specific help with my .htaccess file. I'm new to the Rewrite module and can't quite figure out what I need to do to serve my pages (which live inside some nested directories) up with a nice short URL. So I've got all my new web pages in a...

Answer:

so all your pages live in /newstuff/pages? Try this RewriteCond %{REQUEST_FILENAME} !-d RewriteCond...

Read more

Aquaman at Ask.Metafilter.Com Mark as irrelevant Undo

A php script where you can view a directory, but only open one file?

Hiya, I have a website, i am familiar with PHP, HTML5, and a little perl and Asp. This is a problem i cant seem to figure out. I have a directory of files, i want people i give the link to, to be able to view the entire directory, but if they choose...

Answer:

MySQL is only going to work if these files are stored in a database. If they are, create an authorised...

Read more

Kay S at Yahoo! Answers Mark as irrelevant Undo

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.