How to enable urlManager in Yii for virtual directories? - apache

I'm using xampp and tried to put my yii folder and the webapp folder separate from the htdocs directory. I've followed the instructions from here:
http://el.web.id/how-to-add-virtual-directory-alias-on-apache-xampp-165
I was able to run the main page all right, but the other pages just return a not found status. May I know how to fix this? I'm not even sure if the main problem comes from Apache or from Yii. Thanks a lot.

Oh, I get it now. We'd just need to add a rewritebase on the .htaccess file that matches the alias.
RewriteBase /aliasfolder
This is for reference purposes.

Related

Subdomain using .htaccess only

I wanted to know if it is possible to implement sub domain in a web application, only using trick in the .htaccess file? That is avoiding the following
editing the hosts file for the subdomain link
adding a vhost config for the same
Your help be deeply appreciated.
Thanks.
This is not possible by only using an apache directives.
You can add a rewrite command that changes a link to a subdomain.

How Come Everybody Can See My Private Files?

Sorry for the newbie question...
When I go to http://www.plans4boats.com/scripts/youtubeplayer/ in Google Chrome, I can see a full listing of the files there. What should I do if I don't want any old hacker to just come in and view/copy my source codes? Does it have something to do with htaccess?
I discovered that putting a blank index.html file in the folder helps for THAT folder, but it still leaves all subfolders vulnerable.
What should I google for more information on how to set up my server to prevent this?
Just set Options -Indexes for that particular directories either in an .htaccess file or a <Directory> or <Location> container.
What you need to do is turn of Directory Listing for your specific server. I don't know what server you're using so I can't walk you through it, but just google your server name and how to disable directory listing.
I created a file called .htaccess and put the following contents:
IndexIgnore /

Running Zend site under Alias?

I want to run Zend site under an alias on WAMP. I am able to setup alias, but when I copy a working Zend site there and modify .htaccess to include "RewriteBase /alias", it still does not work. Error messages tell me that controller not found. Mainly this is what happen:
I have: server.com/alias
With Zend file structure inside (application, public, etc).
alias points to c:/wamp/apps/alias
Where Zend structure is stored.
.htaccess has line: RewriteBase /alias
As I understand server.com/alias should act as root folder, but it's not. If I run Zend site under root folder everything works fine then.
Can you tell me how to properly set up alias to run Zend site on WAMP? Thank you.
I think the problem is that your rewrite rules doesn't work well. take a look at this.

Problem in apache2 with mod rewrite when setting rules in .conf files instead of .htaccess

Because of weird security policies of my hosting provider I have to define my rewrite rules in /etc/apache2/conf.d/examplesite.conf instead of writing them on an .htaccess on the www folder of that site.
What I'm trying to do is setup a Wordpress Mu server (http://mu.wordpress.org/forums/topic/17349 ) and so far its working on a 50%.
The main blog loads perfectly but other sub blogs (located for example at www.example.com/blog2 ) don't.
I'm guessing the problem is that the rewrite rules behave differently when declared at .conf files for each virtual host instead of using .htaccess files.
Has anybody else had this problem? How can you fix it?
This doesn't sound like a rewrite problem to me but maybe it is. You don't say what the error is when you try to load one of the sub blogs. Perhaps posting up what your rewrite rule is would be helpful. Also would you be able to set up a scenario where you did them in .htaccess files on a localhost or something and seeing if there was a difference?
If pretty permalinks work, then mod_rewrite is enabled, and rewriting URLs to WordPress successfully.
If this is the case, then it's a problem with your MU install.
Did you choose paths over sub-domains during the MU install? If you didn't, but then later switched, that's where the problem is - are you in a position to fresh install?

Run index.php rather than listing files

I have recently reinstalled MacOSX, and at some point (without realizing it) I made it so that a directory without index.html would try instead to run index.php. This has since stopped working. My localhost runs .php files fine; it just doesn't do so unless you specifically tell it to.
There are lots of htaccess guides online but I can't actually find one that tells me how to solve this problem :s
I believe it's the "DirectoryIndex index.php" directive in .htaccess that will do the trick.