LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   RewriteCond & Rewrite Rule Problemo (https://www.linuxquestions.org/questions/linux-server-73/rewritecond-and-rewrite-rule-problemo-633684/)

sea-bass 04-07-2008 10:44 AM

RewriteCond & Rewrite Rule Problemo
 
Hi Folks,

Ok I know what I want but how to write it I am falling into the land of numptiness...

I have 3 redirects

Code:

RewriteRule    ^/$                    /about/                                [L,R,NC,QSA]
RewriteRule    ^/index.html$          /about/                                [L,R,NC,QSA]
RewriteRule    ^/index.htm$            /about/                                [L,R,NC,QSA]

But what I need is to redirect all in ^/$ to /about/ except sitemap.xml

I have discovered rewritecond and am trying to get this to work, but no luck so far


Code:

#RewriteCond %{REQUEST_URI} !(sitemap.xml)
#RewriteRule ^about([^.]+)\.html$ http://www.myhostname.co.uk/about$1.html?Lang=en [R=301,L]
# Else redirect all others
#RewriteCond %{REQUEST_URI} !\.(html|htm|)$
#RewriteRule (.*) http://www.myhostname.co.uk/about/$1 [R=301,L]

This might be overkill but its the best lead I have so far..

As always appreciate your help...

Sea-Bass


All times are GMT -5. The time now is 09:27 PM.