Elliott C. Back: <3 Wendy Bug

Permalinks Down

Posted in Mod_Rewrite by Elliott Back on May 6th, 2005.

Something changed at the host (1and1), and all permalinks are not working. I’ve contacted their support… we’ll see how fast this gets resolved. Hopefully they just installed a new apache or something and it’ll kick in in minutes…

Update:

Everything should be back to normal now. Before my .htaccess was giving a lot of 404 errors, and none of the mod_rewrite rules were working. It turns out that 1and1 (without telling me) enabled the apache Multiviews setting, which plays havoc with the rewrite rules:

RewriteRule ^archives/…$ /wp/index.php?… [QSA]
RewriteRule ^archives/$ /wp/archives.php

Since I also had a file called archives.php, Apache couldn’t decide whether to apply the rewrite rules in .htaccess or the multiviews logic that said all /archives/ were really archives.php. The solution? Disabling MultiViews in this directory by adding this line to the .htaccess file:

Options -MultiViews

This entry was posted on Friday, May 6th, 2005 at 12:55 pm and is tagged with mod rewrite, htaccess file, php apache, qsa, 1and1, havoc, logic, wp. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback.

12 Responses to “Permalinks Down”

  1. CT says:

    I’m having 500 errors on 1and1 myself, starting last week:

    http://www.populationstatistic.com/archives/2005/06/23/blog-blackouts/

    I’m pretty much a novice administrator; I have a mod_rewrite file, but created it mostly from cribbing from a bunch of sources. Its function (I think) is to enable archive structure and prevent image hotlinking.

    Do you think that “Options - Multiview” line would cure my problems? 1and1 tech support has been predictably clueless.

  2. Interesting. It really depends on what your structure is like. For example, I was having problems because all the archives go to /archives/ which isn’t a real file name, and got mapped to a real file archives.php before mod_rewrite did its magic. If you have something like that, yep, it’s a fix.

  3. James Porter says:

    I thought I would mention that the company I work for has a Dedicated Managed Server with 1and1 (uk). They also turned on Multiviews with no warning and thanks to your blog I managed to get our e-commerce sites back up and running.

    I don’t usualy post on blogs (scaredy cat) but thanks to you and your fix I havent wasted any more of my day. (I have spent almost an entire day trying to work out what went wrong).

    So Thanks :)

    p.s like the blog, added to my rss agg.

  4. [...]

    « Love You More!

    thanks elliottback

    elliottback Just a quick thanks for this blog that saved me from insanity and per [...]

  5. TiemenSchut says:

    WordPress, mod_rewrite and IIS

    That’s quite a contradictive title you must think. IIS and mod_rewrite? How is that possible?
    Very simple. It is NOT possible. Then, if this blog runs on IIS, how is it possible to have this nice permalink-thingie? Pretty simple as well.
    First…

  6. Jon Wade says:

    Hi,

    I hope that you can help me out. I think that what you do with the modre-writes may be what i am looking for, but I am not sure.

    I am rebuilding my website with header.htm, footer.htm, menu.htm files etc and using php includes within my exisiting .html files. (all pages currently built by using save as in the HTML editor) I have been informed that php can be parsed in my .html pages by adding a rule to the .htaccess file, and have found several codes to use, but so far have been unable to get any of them to work. They either result in a request to download and save pages rather than show in the browser, or they do nothing, or result in error 404 (it seems that 404 error is when the link does not specify .html i.e. like http://www.tranquillizer.co.uk/pilates)

    The codes I have tried are:

    AddType application/x-httpd-php .htm .html
    – results in attempted download

    RemoveHandler .html .htm
    AddType application/x-httpd-php .php .htm .html
    - results in attempted download

    AddType x-httpd-php .php .htm .html
    AddHandler application/x-httpd-php .php .htm .html
    – prevents php being read in php file (e.g. http://www.tranquillizer.co.uk/supplement-whey-protein.php)
    and does nothing for .html file (e.g. http://www.tranquillizer.co.uk/phptest.html)

    My server is with 1and1, and so far they have not given a descent response to my problem.

    As a last resord I will have to rename all pages as .php and set up permanent redirects, but I have been informed that this may affect page ranking etc.

    What do you suggest? Is the mod rewrite the solution to this?

    Cheers,

    Jon.

  7. Wendy says:

    Note to Jon: 1and1 uses something a little different than the usual AddType command in the htaccess. Check their faq at http://faq.1and1.com//scripting_languages_supported/php/7.html

  8. Sam S says:

    Hi,

    I am trying to get cakePHP to work with mod rewrite on 1and1. With little or no help from 1and1 support (not the most diligent of workers)

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

    and

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

    all this works on my WAMP server and also on other servers such as Media Temple.

    grateful for any pointers you may have

    thx

    - S

  9. nebulus393 says:

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

  10. Artis says:

    @nebulus393: Thanks! That last comment about CakePHP saved me! I’d tried everything.

  11. Ray says:

    Wanted to write and say THANK YOU!

    I’m no pro at this stuff and after banging my head against the 1&1 wall for a few hours your suggestion got my script working!

    Thank you, thank you, thank you.

    Ray

  12. Jon says:

    You made PHPwcms work for me on 1and1

    Thanks Much

Leave a Reply

Powered by WP Hashcash