I moved my site to a new hoster. Everything works fine (Images path's js css templates, all fine).
I adjusted all path's with Reelocate. But all the Link in the Navigation throw back this error message:
Not Found
The requested URL /subdirectory/segment_1/entry was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
It must have something to do with the subdirectory
In the webroot I have a .htaccess with this:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /subdirectory/$1 [PT,L,QSA]
and then in /subdirectory I have this .htaccess
# Removes index.php from ExpressionEngine URLs
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
# Remove www.
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [L,R=301]
RewriteEngine off
Do I miss something?
Thank you
Edit:
The sollution of Alexa Lohmeyer worked. Here is how it looks if anybody is intrested:
One main error was that I had RewriteEngine off
which somehow even disabled removing index.php.
So the root .htaccess looks like this:
RewriteEngine on
#Remove www
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
#Hosting directive for pointing url to subfolder
RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^(.*)$ /subdirectory/$1 [PT,L,QSA]
And then in the .htaccess of the subdirectory it looks like this:
# Removes index.php from ExpressionEngine URLs
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
# Removes subdirectory from url string
RewriteRule ^subdirectory/index.php?(.*)$ /$1 [L]
segment_1
in the path or is that just a placeholder? It the path is really/subdirectory/segment_1/entry
then to me it would look like EE isn't replacing your segment variables./subdirectory/index.php
the links work. Is it possible to also remove the subdirectory and not just index.php?