Thursday, December 18, 2014

Re: Not allowed use mod_rewrite... Trying to get pretty urls to work... No css or js

Hmm...  that's what I get for editing out the REAL domain name which ended with "t".
Please note:  The Virtual Host definition I included (without the "t") works perfectly when mod_rewrite is used.  I only included it thinking it would help alleveate questions about the setup I was running.

echo $this->Html->css('cake.generic.css');

The line of code above creates a link like this when using pretty urls:
<link href="/app/webroot/css/cake.generic.css" type="text/css" rel="stylesheet">
which is nowhere to be found on the server since the domain is pointing to the /app/webroot folder!


The link using mod_rewrite, and it is the correct link even with pretty urls is:

<link href="/css/cake.generic.css" type="text/css" rel="stylesheet">


In the Html->css function, there is a call to
$this->assetUrl which in turn calls $this->webroot($path)

this->webroot($path)  prefixes /css/cake.generic.css with the /app/webroot.  If the href is altered to not include /app/webroot the <link> that is created works fine!  However, there is not way I've found to specify the Html->css() parameters that doesn't get altered to include /app/webroot




By the way, is there a way to EDIT a previous post so I could correct the "t"?
 


My problem comes when the two changes specified in the documentation are used to setup pretty urls instead of using mod_rewrite.

On Thursday, December 18, 2014 11:49:50 AM UTC-7, John Andersen wrote:
Check the DocumentRoot statement - you have a "t" too much "mydomaint" should "mydomain"
The same in your <Directory statement :)
Enjoy, John

On Wednesday, 17 December 2014 23:52:35 UTC+2, glk wrote:
Thinking... I wanted to add the following info:

<VirtualHost *:8080>
    ServerName mydomain
    ServerAlias mydomain.tld
    DocumentRoot "E:/mydomain/app/webroot"
    <Directory   "E:/mydomain/app/webroot">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    #ScriptAlias /cgi-bin/ "E:/mydomain/cgi-bin/"
    #CustomLog E:/mydomain/app/webroot/log/mydomain_access.log combined
    #ErrorLog  E:/mydomain/app/webroot/log/mydomain_error.log
    LogLevel warn
</VirtualHost>



--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: