Problem with symlink url


I’m currently hosting a rail application in a subdomain. I was told that it’s not supposed to work, but it’s except that I have to put a “/” at the end of url to make it work: <-- will work <-- give me a bad request error

Is there a way to fix this? “app” is basically a symlink which points to the public directory of the application.



Do you have an .htaccess file which does some kind of behind the scene rewrite?

By default, Apache will add the / to directories, even symlinked ones, however, if you have a .htaccess file altering what will do, then it won’t work.


Make sure your symlink target has a trailing slash:

ln -s /path/to/target/directory/ symlink_name

If you want useful replies, ask smart questions.


This is what I did to create the symlink

ln -s /path/to/target/directory/ symlink_name

So I don’t think that was the problem. As for the .htaccess, I don’t think I did anything to it. I’ll look into it though.


What does your error log say?

If you want useful replies, ask smart questions.


There’s nothing in the log file that is useful. I also checked the .htaccess file and restored it to the initial state.

I think the issue might be the fact that the symlink name is different from the application name. I couldn’t create a symlink with the same name because it didn’t let me. So if the name of the application is “app” then the symlink is “apps”. If I just type in, it would not direct to the public directory, but gives me a list of directory instead.

Any suggestion? BTW, this is an application in a subdomain, not subdirectory.



Your example URLs shown in your first post didn’t have any subdomain in them. A subdomain is something like, which is a subdomain of A subdirectory is like A subdirectory in a subdomain would be like It’s always a good idea to include the trailing slash when citing a subdirectory URL, to avoid an unnecessary server redirect.

– Dan


It’s definitely a subdomain. I just didn’t type everything in the post. I still haven’t figured out a way to fix it after trying so many things. I’m still getting “Bad Request Error” every times if I don’t explicitly type “/” at the end.

Any other ideas?