mod_rewrite Help!

Status
Not open for further replies.

LazyD

$monies = false;
Dec 7, 2006
655
12
0
Wine Cuntry
wildfoxmedia.com
Im working on a site thats using CakePHP which requires the use of mod_rewrite rules, the only trick with it this time is that they want the current site to still be active to the public until such time they ddem the site ready to go.

There is an index.html site that does a meta refresh to the URL /version02/index.html

Is there a way I can set a RewriteCond that should do a redirect unless the requested URL is the one above so that the public can still visit the root index.html and have the meta refresh work?

The .htaccess file im trying is below.... For some reason, when I go to the main site it gets parsed out by Cake even though index.html is present...

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !/version02/index.html
RewriteRule ^$ app/webroot/ [L]
RewriteCond %{REQUEST_URI} !/version02/index.html
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
 


If the old site is made of static HTML/CSS/image files, it could be possible to avoid redirecting them by using special mod_rewrite rules. This is .htaccess I am currently using for my projects, and it doesn't redirect static files (which is correct behavior):

Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.+$ - [S=40,L]
RewriteRule ^/*([^/]+/+)*([^.]*[^/])$ http://%{HTTP_HOST}%{REQUEST_URI}/ [L,R=301]
RewriteRule . index.php [L,QSA]
 
Why not put the cakephp site in a subdomain while your working on it till they are happy - - when your ready you would just have to change the routes file correct?
 
Tried that....

I should have mentioned that this is on 1&1 hosting which has proved to be one of the most touchy and all together crappy hosting solutions ive ever had the displeasure of using (Client is using it and doesnt want to switch)

Houdas, ill give your rules a go, thanks
 
I hate 1 and 1 - warning. I'm convinced their mod_rewrite is all screwed up. Things that work on every other host I've ever used just don't work there.
 
I hate 1 and 1 - warning. I'm convinced their mod_rewrite is all screwed up. Things that work on every other host I've ever used just don't work there.

That's true. I spent three fucking hours last time trying to debug my mod_rewrite rules, only to realize that their system is fucked up.
 
I agree.... Its pretty awful that a fresh install of CakePHP that works on any other environment automatically fails miserably on 1&1...

Im basically doing contract code work for the guy that owns the company and he uses 1&1 for all his clients... I asked him if he thought about switching, but he says he loves them... Why? I have absolutely, 0 idea.. I had them years ago and they sucked donkey dick and still do....
 
The best part is when you do contact them about it they will just inform you that mod_rewrite is on and the problem is with your code.

Don't take to long screwing around with it.... or I'm sure that contract will be sorta worthless. 1 and 1 is NOT for anything complex... or beyond html really.
 
I realized I phrased my last response incorrectly...

Im doing project based contract work for a guy that does web design, however, his idea of web design is basically shopping out every part of the job except general client contact. He is the one with 1&1 and he loves them because its so easy (aka: Tard Proof (He == Tard))

Beyond this he is the most helpless person ive ever seen.... I built a CMS for a reason, to make it easy for him and the clients to easy update there site on the fly, however he is telling me 'Heres the content for X page, can you put Coming Soon on this page' - its like... You can do that fucko...

Long story short, im pretty much done doing work for him
 
Status
Not open for further replies.