Question

First of all: I noticed a lot of topics on similar issues and I've read quiet a bunch of them. However non seem to be of the exact same nature as the error I'm having.

Within my DirectAdmin panel I've created a subdomain called projects, DirectAdmin automatically generates the structure on the FTP, the subdomain resolves to the folder public_html/projects/. Within this folder I'm planning on having folders per client to add their projects.

Let's kick of with an example:

  1. Client called 'johnson'
  2. Project called 'cars'
  3. In this folder there is an index.html file
  4. The htaccess file is within this project folder (cars)

The domain to this project is http://projects.mydomain.com/johnson/cars/ and the internal structure is public_html/projects/johnson/cars/. Without a htaccess file everything works perfect, the index.html is opened automatically.

Now comes the part that is causing the issues. I'm using htaccess to rewrite URLs which used to work without any problems on the www. subdomain, but since I'm working in the projects folder it's causing 403 errors.

What I'd expect to work was:

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    Options -Indexes

    RewriteEngine On
    RewriteBase /johson/cars/

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^(.*?)$ test.php?vars=$1 [L] 
</IfModule>

test.php is nothing much, just a file that var_dump()'s the $_GET variables. But instead of this page the 403 error shows up.

I tried a ton of things, such as:

  1. RewriteBase /cars/
  2. RewriteBase /projects/johnson/cars/
  3. RewriteBase /projects/
  4. RewriteBase /johnson/ (pretty much every thinkable variation)
  5. RewriteBase /
  6. Added RewriteCond %{HTTP_HOST} ^projects\.mydomain\.com$ [NC] in front of the RewriteRules

But nothing seems to help.. I'm kind of stuck and I am clueless where to look. I've tried different searches on here and on Google. Perhaps I'm using the wrong keywords, but I can't find a similar probler and I've been trying to incorporate sollutions to other problems to mine without any success.

Thanks for the help.

Was it helpful?

Solution

I've had a similar problem in the past. After about a week of fruitless trying to get it to work I found out that both .htaccess files were interfering with each other. What I did is make the subdomain a seperate domain under the same clientname in directadmin

OTHER TIPS

I redirected my subdomain to another link by creating a .htaccess file in the related folder, with the content:

Redirect / http://yourlink
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top