3

I edited my cake.generic.css file and since then css doesn't work at all. Everything else on the site works, but cakephp says on the site's index that "URL rewriting is not properly configured on your server. 1) Help me configure it 2) I don't / can't use URL rewriting."

My .htaccess files are exactly like explained here: .htaccess for cakephp.

All the text on the site is white against a white background. I can access my css file at http://domain.com/css/cake.generic.css.

Any thoughts? I can provide more info if you will just tell me what you need. Thanks for your help!

Community
  • 1
  • 1
flint
  • 345
  • 5
  • 15
  • does the url `/asdf` show a missing Asdf controller error - or a webserver 404? The warning you refer to is simply hidden by css, so if the only thing you've done is edit the css file, it will show the warning even if it's irrelevant. – AD7six Jul 27 '13 at 19:54
  • Yes I get error messages just with white text against a white background. It wasn't showing that warning until I edited that css file, then all the styles for the whole site just dissapeared and I'm stuck with white text on a white background. I contacted my host and they don't see any issues with mod_rewrite. – flint Jul 27 '13 at 20:03
  • 1
    You don't have any issue with mod rewrite - the problem is you've borked the css file, just unbork it (and don't put your own styles in that css file - put them in a different file). – AD7six Jul 27 '13 at 20:05
  • 1
    @AD7six put that in an answer so we can vote it up. – Scott Harwell Jul 27 '13 at 20:10

2 Answers2

3

I fixed issue by uncommenting this line in app/core.php Configure::write('App.baseUrl', env('SCRIPT_NAME'));

Nezir
  • 6,727
  • 12
  • 54
  • 78
1

There is no mod rewrite problem

Everything else on the site works

The default home page contains the following:

<p id="url-rewriting-warning" style="background-color:#e32; color:#fff;">
    <?php echo __d('cake_dev', 'URL rewriting is not properly configured on your server.'); ?>
    1) <a target="_blank" href="http://book.cakephp.org/2.0/en/installation/url-rewriting.html" style="color:#fff;">Help me configure it</a>
    2) <a target="_blank" href="http://book.cakephp.org/2.0/en/development/configuration.html#cakephp-core-configuration" style="color:#fff;">I don't / can't use URL rewriting</a>
</p>

The important point there - is that it has inline styles and an id.

Of relevance, the css file contains the following rule:

#url-rewriting-warning {
    display:none;
}

I.e. it's always present and hidden by css.

If the cake.generic.css file has been edited removing that rule, the mod rewrite warning will be shown even though mod rewrite works fine.

The css file has been edited

I edited my cake.generic.css file and since then css doesn't work at all

It's not a good idea to edit cake.generic.css. Restore to the original state, create a css file for your own rules, e.g. webroot/css/styles.css, put css rules in it and link to it in the layout:

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

i.e. add to/overwrite the generic styles (if they are needed at all), don't edit them directly.

Community
  • 1
  • 1
AD7six
  • 63,116
  • 12
  • 91
  • 123