Re: CakePHP configuration or .htaccess?

2009-04-27 Thread Jimson

A solution was found! (Thanks Martin)

By moving the cake core (cake/) and the application files (appname/)
to my home directory ~user/ and only have the files from appname/
webroot in ~user/public_html/ I got what I wanted.

But to make it work with the new file locations, I had to update
index.php (now located in ~user/public_html/) since that file defines
ROOT, APP_DIR and CAKE_CORE_INCLUDE_PATH. Finally I had to revert back
to the original .htaccess files.

A positive side effect - besides solving my link issue - the site
security has been improved since the cake core and the application
files now are located in a place where they are not exposed as they
would be in the directory ~user/public_html

Again, thanks Martin.

On 27 Apr, 11:12, Martin Westin  wrote:
> Did I get this right?
> You are serving the website aswww.mydomain.comnot sharedhost.com/
> ~user/appname/ ?
>
> If so, then you should do things slightly differently as the
> RewriteBase will be / (root of mydomain.com).
> I haven't installed in this way... ever (I think), so I don't want to
> give any further advice on what tweaks to do but the difference
> between hosting under the usename alias or the "real" domain is
> significant.
>
> On Apr 27, 10:02 am, Jimson  wrote:
>
> > By adding
>
> > RewriteBase /~user/
>
> > I do get into some circular reference and the server responds with a
> > server configuration error. Cannot set DebugLog-level on server since
> > the application resides on a shared hosted environment.
>
> > - Jim
>
> > On 27 Apr, 02:54, Marcelo Andrade  wrote:
>
> > > On Sun, Apr 26, 2009 at 2:21 PM, Jimson  wrote:
>
> > > > (..)
> > > > On the server, I have the directory
> > > >        ~user/public_html/
>
> > > To use CakePHP with the mod_rewrite, you need to
> > > edit your (3) .htaccess files, including something as
>
> > > RewriteBase /~user/
>
> > > just after the line with "RewriteEngine on"
>
> > > Best regards.
>
> > > --
> > > MARCELO DE F. ANDRADE
> > > Belem, PA, Amazonia, Brazil
> > > Linux User #221105
>
> > >http://mfandrade.wordpress.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP configuration or .htaccess?

2009-04-27 Thread Martin Westin


Did I get this right?
You are serving the website as www.mydomain.com not sharedhost.com/
~user/appname/ ?

If so, then you should do things slightly differently as the
RewriteBase will be / (root of mydomain.com).
I haven't installed in this way... ever (I think), so I don't want to
give any further advice on what tweaks to do but the difference
between hosting under the usename alias or the "real" domain is
significant.


On Apr 27, 10:02 am, Jimson  wrote:
> By adding
>
> RewriteBase /~user/
>
> I do get into some circular reference and the server responds with a
> server configuration error. Cannot set DebugLog-level on server since
> the application resides on a shared hosted environment.
>
> - Jim
>
> On 27 Apr, 02:54, Marcelo Andrade  wrote:
>
> > On Sun, Apr 26, 2009 at 2:21 PM, Jimson  wrote:
>
> > > (..)
> > > On the server, I have the directory
> > >        ~user/public_html/
>
> > To use CakePHP with the mod_rewrite, you need to
> > edit your (3) .htaccess files, including something as
>
> > RewriteBase /~user/
>
> > just after the line with "RewriteEngine on"
>
> > Best regards.
>
> > --
> > MARCELO DE F. ANDRADE
> > Belem, PA, Amazonia, Brazil
> > Linux User #221105
>
> >http://mfandrade.wordpress.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP configuration or .htaccess?

2009-04-27 Thread Jimson

By adding

RewriteBase /~user/

I do get into some circular reference and the server responds with a
server configuration error. Cannot set DebugLog-level on server since
the application resides on a shared hosted environment.

- Jim

On 27 Apr, 02:54, Marcelo Andrade  wrote:
> On Sun, Apr 26, 2009 at 2:21 PM, Jimson  wrote:
>
> > (..)
> > On the server, I have the directory
> >        ~user/public_html/
>
> To use CakePHP with the mod_rewrite, you need to
> edit your (3) .htaccess files, including something as
>
> RewriteBase /~user/
>
> just after the line with "RewriteEngine on"
>
> Best regards.
>
> --
> MARCELO DE F. ANDRADE
> Belem, PA, Amazonia, Brazil
> Linux User #221105
>
> http://mfandrade.wordpress.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP configuration or .htaccess?

2009-04-26 Thread Marcelo Andrade

On Sun, Apr 26, 2009 at 2:21 PM, Jimson  wrote:
>
> (..)
> On the server, I have the directory
>        ~user/public_html/

To use CakePHP with the mod_rewrite, you need to
edit your (3) .htaccess files, including something as

RewriteBase /~user/

just after the line with "RewriteEngine on"

Best regards.

--
MARCELO DE F. ANDRADE
Belem, PA, Amazonia, Brazil
Linux User #221105

http://mfandrade.wordpress.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



CakePHP configuration or .htaccess?

2009-04-26 Thread Jimson

I have developed a Cake-application for the first time and now I am
about to put it up in a shared environment running FreeBSB with
apache2 as web server.

On the server, I have the directory
~user/public_html/

I have uploaded the cake application to the public_html-directory so
now do my file structure look like:
~user/public_html/cake  /* The cake core  */
~user/public_html/appname
|-config
|-controllers
|-...
\-webroot

After some work with .htaccess, I have been able to access my
application directly via
http://www.mydomain.com/
(~user/public_html is pointing to appname/webroot via a RewriteRule
in .htaccess)

So far so good!

Now to my problem. In any link generated by cake the URL includes the
"appname", e.g. I have a link to "about" which says
http://www.mydomain.com/appname/about
and the same information is accessable via
http://www.mydomain.com/about

>From an estetical point of view, the latter is preferred. I would like
to remove the appname from all links generated in my application since
there is no benefit having that information in there.

I have tried some RewriteRules and I have also tried to solve it in
the application configuration by setting App.baseUrl to '/'. The
latter is removing the appname from the links and everything seems to
work, but then login is not working any longer. (I am using the Auth-
component for authentication, no rocket-science there...).

The .htaccess file in ~user/public_html looks like:

   RewriteEngine on
   RewriteRule^$ appname/webroot/[L]
   RewriteRule(.*) appname/webroot/$1 [L]


The .htaccess file in ~user/public_html/appname looks like:

RewriteEngine on
RewriteRule^$webroot/[L]
RewriteRule(.*) webroot/$1[L]
 

and the .htaccess file in ~user/public_html/appname looks like:

RewriteEngine On
RewriteBase /appname/webroot
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]



My question now, is my problem a cake-configuration problem or could I
solve my problem via .htaccess-instructions? Any suggestion in the
right direction is very much appreciated.

TIA,
Jim

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---