I need to redirect a page on a client site to an outside URL. I have been using the following redirect, which works - sort of:
redirect 301 /durhamchapelhill http://gds.chapelhilluumc.org
The problem is that the resulting URL is cluttered:
I sought help on StackOverflow and got a really good redirect
RewriteEngine On
RewriteBase /
RewriteRule ^durhamchapelhill$ http://gds.chapelhilluumc.org [R]
By itself, it does an awesome job and returns a nice clean URL. Which brings up the thorny issue of hiding the index.php page.
Before all of this started I was using the following to hide index.php and it works great:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
The problem is I need both (hide index.php and redirect).
Here is the combination I tried:
RewriteEngine On
RewriteBase /
RewriteRule ^durhamchapelhill$ http://gds.chapelhilluumc.org [R]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
However, if I combine the two rules the redirect fails.
Is there an htaccess doctor in the house that can assist with setting this straight?
Thanks!