Member
Member
navjotjsingh   25-12-2009, 16:16
#1

I know that following code is required for redirecting a non www link to www link:

RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.domain\.com RewriteRule (.*) http://www.domain.com/$1 [L,R=301]
And I have included it too on the main site's .htaccess. But the problem is that I have a gallery in a subfolder.

If I access http://domain.com/gallery/ it does not get redirected to www version.

I tried including the above code into .htaccess in gallery folder but then it redirects the gallery to site's homepage.

Pls suggest a fix so that non www gallery redirects to gallery having www link.

Member
Member
navjotjsingh   26-12-2009, 07:50
#2

No SOlution?

Member
Member
micheall   26-12-2009, 08:36
#3

try adding this to the top of your rule (if you don't already have it):

Options +FollowSymLinks

I'm not super familiar with .htaccess myself but from a quick search on google I found the same htaccess rules you used, but with the code above at the top.

Member
Member
navjotjsingh   26-12-2009, 10:38
#4

Found the fix.

SHould use this code:

RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.domain\.com RewriteRule (.*) http://www.domain.com/gallery/$1 [L,R=301]

Administrator
Administrator
acrylian   26-12-2009, 10:45
#5

Do your really expect that fast help over Christmas days??? Anyway, these kind of redirection I can set via the admin backend of my provider.

Member
Member
navjotjsingh   26-12-2009, 10:48
#6

Nope..I don't expect fast help in holidays. I am just posting my queries...you can answer them whenever you get time.

Its just that I am free on holidays and I am working on making my own gallery perfect with ZP in these days.

Administrator
Administrator
acrylian   26-12-2009, 10:53
#7

Sure, but your second post above was a little impatient..;-)

Member
Member
navjotjsingh   26-12-2009, 10:54
#8

Sorry.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.