Go Back   Forums @ The Digital Fix > Gadgets and Gizmos > Computing Forum

Reply
 
Thread Tools Display Modes
Old 04-04-2008, 09:04   #1
Guest 32699
Banned
 
Join Date: Jun 2003
Posts: 3,573
Thanks: 0
Thanked 0 Times in 0 Posts
little htaccess/wordpress/site/404 help please

Hi

I have a website at www.xxx.com which has it's own custom 404 page defined in the .htaccess file

I have a wordpress installation at www.xxx.com/blog with permalinks switched on.

The wordpress blog at www.xxx.com/blog is overwriting the custom 404 for the main site and dumping everyone who goes into the main site and hits a broken link into the blog 404.

help!!!!

htaccess is currently

AddDefaultCharset Off
Options -Indexes
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host** ^xxx.com [nc]
rewriterule ^(.*)$ http://www.xxx.com/$1 [r=301,nc]

deny from 209.59.166.51
deny from 64.202.163.78

ErrorDocument 404 http://www.xxx.com/warning.php


RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME** !-f
RewriteCond %{REQUEST_FILENAME** !-d
RewriteRule . /blog/index.php [L]

Last edited by saigon; 04-04-2008 at 09:14.
Guest 32699 is offline   Reply With Quote
Old 04-04-2008, 10:22   #2
Chris Locke
Making a 1% improvement
 
Join Date: Sep 2000
Location: Essex, UK
Posts: 7,514
Thanks: 627
Thanked 1,847 Times in 643 Posts
the .htaccess files can be in any directory, so you just need an .htaccess in the blog directory to point to the blog error, and the one in the root to point to the site error page.

The references to the error pages should be from the root, eg, /blog/404.php (or fully qualified, as you have it). Just a '404.html' didn't work in a /test directory when I tried it on my server.

The .htaccess in the blog directory just needs the ErrorDocument reference.

Last edited by Chris Locke; 04-04-2008 at 10:39.
Chris Locke is offline   Reply With Quote
Old 04-04-2008, 10:48   #3
Guest 32699
Banned
 
Join Date: Jun 2003
Posts: 3,573
Thanks: 0
Thanked 0 Times in 0 Posts
Cheers Chris.

I thought wordpress had automatically added their bit to the htaccess file....I only realised when you said it that I did it by hand rather than sticking it in it's own htaccess file in the blog directory...

...feel like such an idiot

all sorted

Last edited by saigon; 04-04-2008 at 10:48.
Guest 32699 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
wordpress blog : a few Q's Guest 3999 Computing Forum 6 30-01-2008 15:08
Redirect one URL to another with htaccess? ColinP Computing Forum 9 28-12-2007 15:07
htaccess rewrite help Guest 43811 Computing Forum 3 11-03-2007 01:57
Need help with Wordpress escape_adil5 Computing Forum 0 30-08-2006 08:28
.htaccess help Dean[SAS] Computing Forum 1 13-04-2006 09:12

All times are GMT. The time now is 16:17.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.qq
Copyright ©2000 - 2021 Network N Ltd.