Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 10-24-2007, 07:33 AM   #1
LQ Newbie
Registered: Oct 2007
Posts: 10

Rep: Reputation: 0
Question Apache RewriteEngine issue when typing URL

Hi all

When you visit this site:
you get straight through to the wordpress blog, which is great, no problem.

Now the issue is that if you manually type in the "/advice" you get redirected to which then presents a 404 page from wordpress.
To stress this point:
Manually type in "/advice" in the URL after (minus the quotes of course

If you manually type in /advice/
then it works fine.

I have a layered structure, where all the frontend (website stuff), lives in the GUI directory.

I have 2 .htaccess files. One in the site directory as follows:

ErrorDocument 404 /GUI/404.htm

RewriteEngine on
Options +FollowSymLinks

RewriteCond %{HTTP_HOST} ^
RewriteCond $1 !^GUI/
RewriteRule ^(.*)$ /GUI/$1 [L]

RewriteCond %{HTTP_HOST} ^office-connection\.com$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]

And another .htaccess file in the GUI/advice folder, as follows:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /advice/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /advice/index.php [L]

# END WordPress

Any ideas on what why this is happening when the /advice is manually typed into the URL? Definately got me stumped that's for sure.

Any help / advice would be greatly appreciated.


Last edited by SupremeUK; 10-24-2007 at 07:36 AM.
Old 10-26-2007, 06:11 AM   #2
LQ Newbie
Registered: Oct 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Thumbs up Solution found

Solution has been found, so I thought I'd post it up because it was a strange one.

Basically the 2 htaccess files were conflicting with each other, so this line was added into the root htaccess, before any of the other rules:
RewriteRule ^advice$ /advice/ [R=301,L]

Working great now - Thanks to Keith for the help


apache, rewriterule

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache URL issue - will redirect help... rlprofessional Linux - Newbie 9 06-16-2006 12:43 PM
apache and url help cambie Linux - Software 1 08-11-2005 09:49 AM
Apache RewriteEngine ApacheMan252 Linux - Software 10 09-04-2003 02:43 AM
RewriteEngine andy18 Linux - General 1 03-31-2003 01:59 PM
Apache Url simquest Linux - Software 2 11-26-2002 04:46 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:12 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration