htaccess + 1and1 + clean urls + CSS

eparada / 2009-06-22 01:47:43   

Hello all, and thanks in advance for your help. My (in-progress) site is http://index.christolles.com

1. I'm using 1and1 as a host, which "apparently" has problems with clean urls, though I can't understand why. I get 500 errors when I enable them.

2. Found this post in which krebber suggests a htaccess edit workaround, did it, clean urls achieved:

http://www.indexhibit.org/forum/thread/1941/

3. BUT though I now have clean urls, I also have the same lack-of-CSS exactly as described in this thread by saltherring:

http://www.indexhibit.org/forum/thread/2960/

So obviously clean urls are possible, but I'm too ignant to understand how to fix my CSS. Please help!

eparada / 2009-06-22 01:52:00   

obviously (due to the url of my site) i'm also running indexhibit in a subdomain, but haven't gotten a clear instruction as to whether i have to edit .htaccess to account for this.

i have not .htaccess in root, and nothing on my server runs directly from the root (all subdomains)

eparada / 2009-06-22 01:56:54   

holy crap i feel like an idiot with all these replies, but i also have the bizarre issue of being automatically logged in as the wrong user! as you can see, my posts have been as "eparada", but I'm actually "christolles"!

When I enter my email address (christollesbulk [at] gmail [dot] com) and password, *poof* I'm logged in as "eparada". sigh.

Ernie Parada, wherever you are, I'm sorry...

eparada / 2009-06-22 02:08:01   

update again. i'm offically a forum idiot and thank you for your patience. i found a post about french hosts and .htaccess issues, and followed the recommended alternative .htaccess code from this post:

http://www.indexhibit.org/forum/thread/42/

but did NOT change the filename to include .fi, and it seems to be working.

any ideas here? do i really need to know what i've changed in my .htaccess file? i really don't understand ANY of the changes I'm making...

I've also tried the alternative .htaccess that Vaska suggests here, and get the same 500 error:

http://www.indexhibit.org/forum/thread/42/

eparada / 2009-06-22 02:26:29   

unbelievable. i promise i won't post for a while to atone for my atrocious forum behavior.

the most recent update is that the french .htaccess code does NOT work. it worked once, and now no more. to reiterate:

1. the stock clean url approach gets me the standard 500 errors

2. the alternative .htaccess text from krebber in this post gets breaks my CSS:
http://www.indexhibit.org/forum/thread/1941/

3. the alternative .htaccess text from Vaska in this post gets me 404 errors:
http://www.indexhibit.org/forum/thread/42/

4. the alternative .htaccess text from fafa007 in this post gets me 404 errors:
http://www.indexhibit.org/forum/thread/1715/

for the time being, i'm reinstated the standard .htaccess with sloppy urls and promise not to post again until someone else replies.

popeluke / 2009-06-28 00:12:42   

I am using 1and1 as well and facing the same problem that the CSS of my sections is not working at all.

using currently this htacess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

reading all the threads but didn't find anything solving the issue

Vaska A / 2009-06-28 00:16:23   

This is a really tough one. As best as I can tell they have different setups for their servers. I myself have spent time trying to make things works and while some people have been able to make this work I've seen some people on this host never get it to work. I think I've spent two hours searching the web for solutions and trying everything I could think...this is a tough one to solve.

philippe / 2009-07-02 14:34:21   

Hi there,

here is the solution that works for me, on 1and1.

I had the same issues as everyone when following the tutorial: http://www.indexhibit.org/tutorial/how-to-get-clean-urls/
with 500 errors.

what I did was adding one extra line (the one in bold) in my .htaccess file so that it looks like:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteBase /
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.+) index.php

Hope that helps people. I was struggling too.

GordonBennett / 2009-07-02 15:22:27   

philippe you are my hero!

A million and one kudos points. It worked perfectly.

Thanks again.

selu / 2009-07-06 10:29:34   

my hero too!!!!

selu / 2009-07-06 10:29:55   

my hero too!!!!

jessecolinjackson / 2009-07-08 02:44:46   

And my hero too. Although I just arrived.

Note: to any newbies setting up a site as a subdomain, the final line in .htaccess needs to be rewritten as:

RewriteRule ^(.+) [FULLPATH]/index.php

(temporarily http://www.ericamah.com/jessesnewsite/)

paul_m / 2009-07-13 09:17:57   

An my hero too :D

Vaska A / 2009-07-13 10:42:32   

Woot for Phillipe!

;)

bobbystone / 2009-07-20 11:30:19   

my hero too !!
I just arrived.
thanks phillippe!

oapostropheb / 2009-08-11 18:21:22   

Yippee, Philippe! Thank You!

ivancruz / 2009-09-16 22:42:47   

Also try changing the .htaccess permissions to 777, it some how worked for me.

olmo / 2009-10-25 22:22:08   

Can i shout a double Woot woot for Phillipe?
This solution is also working on PCextreme (Holland) host

aaddaamm / 2010-05-19 17:16:59   

Thanks philippe , this has been fuking me over for days...

saltherringtoo / 2010-05-31 16:33:42   

Just getting to this post now... I was having similar problems as christolles. He referenced my initial post
here: http://www.indexhibit.org/forum/thread/2960/

I have tried all of the .htaccess modifications listed here and elsewhere on the site. I can achieve clean urls but it overrides my stylesheet preventing any modification to the look of the site.

Here's what I currently have in my .htaccess file:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteBase /
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.+) index.php

Any help will be MUCH appreciated. Philippe, any magic you can conjure up for me??

Thanks!

saltherringtoo / 2010-05-31 16:35:51   

I should mention that my homepage joelwanek.com/index.php is fine - it retains the style set in my .css

I just need all the other pages to follow suit!

:-)

Vaska A / 2010-05-31 16:55:02   

Works just fine for me...

saltherringtoo / 2010-05-31 17:38:33   

well, the homepage works fine and looks fine as i stated.

however did you navigate into my site further? clicking any of the links on the menu and my .css is gone. all the pages should look like the homepage:

http://www.joelwanek.com

saltherringtoo / 2010-05-31 17:39:55   

any other thoughts or ideas?

i'm assuming i need to add some other line to my .htaccess file but i don't have any clue what it could be.

thanks!

joel

Vaska A / 2010-05-31 17:44:12   

Woops...I'm wrong. But...what is this?

  1. </li><LINK REL=StyleSheet HREF="style.css" TYPE="text/css" MEDIA=screen>

You embedded the style.css file into the textarea? I'm not sure what's going on or why you would do it that way. So, of course, it's having some issues.

The problem is clear now?

saltherringtoo / 2010-05-31 17:46:29   

man, i wish! i'm fairly illiterate here...

so, i'm not linking to my stylesheet properly?
what should it say/read?

thanks so much!!

saltherringtoo / 2010-05-31 17:48:33   

should TYPE="style.css"

is this something i should change in my .css?

my apologies, i'm not fluent at all with any of this.

thanks again.

joel

Vaska A / 2010-05-31 17:58:36   

Well, it should go directly into the template. In Useful Threads there is a primer on this kind of thing (the links in red). And, when you look at your template note how we get the full (absolute) path to your style.css file. You can't access it because you are only addressing it locally...

saltherringtoo / 2010-05-31 18:20:56   

got it. thanks so much!

Vaska A / 2010-05-31 18:29:23   

I know it drives people crazy at times...but myself, Pindaros, Mathieu...and the other people who help around here...know that these things are understandable because we are all designers too (first and foremost). A little knowledge takes people a long way...

dansk / 2010-07-13 16:14:43   

@philippe wow that's superb! I just checked my friend's site and got that horrible Internal Server Error. No idea what caused it, I imagine it was something my friend tried to upload cause it was working last night.

Genius!

Nesquita / 2010-10-09 23:41:18   

Hello everyone,

I'm having same problems with 1&1. I tried to do what Philippe said... I added RewriteBase/ to .htaccess and changed defaults.php but it's not working for me. 500 errors keep appearing at all times :(

Not sure if I'm missing anything:

1 add . to htaccess: .htaccess
2 write RewriteBase/ in .htaccess (exactly where Philippe said)
3 change define('MODREWRITE', false); to define('MODREWRITE', true);

Any help would be really appreciated!

Thanks a lot in advance.

L.

Nesquita / 2010-10-09 23:42:01   

Hello everyone,

I'm having same problems with 1&1. I tried to do what Philippe said... I added RewriteBase/ to .htaccess and changed defaults.php but it's not working for me. 500 errors keep appearing at all times :(

Not sure if I'm missing anything:

1 add . to htaccess: .htaccess
2 write RewriteBase/ in .htaccess (exactly where Philippe said)
3 change define('MODREWRITE', false); to define('MODREWRITE', true);

Any help would be really appreciated!

Thanks a lot in advance.

L.

Nesquita / 2010-10-09 23:42:25   

Hello everyone,

I'm having same problems with 1&1. I tried to do what Philippe said... I added RewriteBase/ to .htaccess and changed defaults.php but it's not working for me. 500 errors keep appearing at all times :(

Not sure if I'm missing anything:

1 add . to htaccess: .htaccess
2 write RewriteBase/ in .htaccess (exactly where Philippe said)
3 change define('MODREWRITE', false); to define('MODREWRITE', true);

Any help would be really appreciated!

Thanks a lot in advance.

L.

ekatedesign / 2010-10-24 17:33:25   

Hello, Me too! I have tried everything on the site concerning cleaning up URL's and I'm also with 1&1.
I have tried all the tips on several of the forum listings and this one (as above). I am currently having 500 error when I click on any page other than the home page. As Nesquita mentions above, can anyone help on this. Or is i sometomes just not possible to have clean URLS?

eastdevonstainedglass.co.uk

ekatedesign / 2010-10-24 17:35:24   

Hello, Me too! I have tried everything on the site concerning cleaning up URL's and I'm also with 1&1.
I have tried all the tips on several of the forum listings and this one (as above). I am currently having 500 error when I click on any page other than the home page. As Nesquita mentions above, can anyone help on this. Or is i sometomes just not possible to have clean URLS?

eastdevonstainedglass.co.uk

artishard116 / 2010-12-02 11:45:06   

this worked for me, thanks

0leg / 2011-01-26 22:51:59   

Hi all,

I ran into the same, yet a little different problem with getting clean url on 1and1. I installed indexhibit to a subdirectory (not root) on my site: http://oleglyutov.com/indexhibit

  1. 1. I followed the original clean url instructions: .htaccess + define('MODREWRITE', true);
  2. As a result I was getting 404 error - not 500 error as this original thread mentions.
  1. 2. Then I applied Philippe's fix to .htaccess:
  2. RewriteEngine on
  3. RewriteCond %{REQUEST_FILENAME} -f [OR]
  4. RewriteCond %{REQUEST_FILENAME} -d
  5. RewriteBase /
  6. RewriteRule ^(.+) - [PT,L]
  7. RewriteRule ^(.+) index.php
  8. Now clicking a link returns me the following:
  9. <strong>Multiple Choices
  10. The document name you requested (/index.php) could not be found on this server. However, we found documents with names similar to the one you requested.

Available documents:

* /index.swf (common basename)
* /index.html (common basename)

Please consider informing the owner of the referring page about the broken link.
The listed files come from the root folder and have nothing to do with my indexhibit directory. Note that url became clean; this error page was displaying the address of the link I previously clicked on. I was researching for some posts on this issue and similar problem was occurring to people who accidentally relocated some files, which is not the case here.

Would greatly appreciate any help.

0leg / 2011-01-26 22:55:07   

OOPS, looks like I messed something up with the tags on my post.

0leg / 2011-01-27 00:03:46   

I resolved it.
I tried jessecolinjackson addition to the code and it worked with some exception.
he suggests changing the last line to the following:
RewriteRule ^(.+) [FULLPATH]/index.php
I did this and I wasn't getting an error page anymore, but my content wasn't displaying either - just menu.

  1. So I decided to treat the site's folder as the beginning of the path - ignoring the higher levels and it worked.
  2. So given that this is my indexhibit containing url:
  3. http://oleglyutov.com/indexhibit/
  4. my .htaccess code looks like this:
  5. RewriteEngine on
  6. RewriteCond %{REQUEST_FILENAME} -f [OR]
  7. RewriteCond %{REQUEST_FILENAME} -d
  8. RewriteBase /
  9. RewriteRule ^(.+) - [PT,L]
  10. RewriteRule ^(.+) /indexhibit/index.php

good luck!

Jule / 2011-04-24 10:48:40   

Thank you!! this was my problem as well... sorry for all my post in diffrent threats...

rp / 2011-12-27 13:25:09   

Thanks!! You really helped me out on this one!

This thread has been closed, thank you.