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!

4
  • 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. Commented Jul 27, 2013 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. Commented Jul 27, 2013 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). Commented Jul 27, 2013 at 20:05
  • 1
    @AD7six put that in an answer so we can vote it up. Commented Jul 27, 2013 at 20:10

2 Answers 2

3

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

Sign up to request clarification or add additional context in comments.

Comments

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.

1 Comment

Thank you very much! Got it all working, and I won't tweak that file in the future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.