![]() |
.Htaccess/Mod_Rewrite ninjas inside plz.
Ok, I am doing a simple domain.com to www.domain.com redirect, and it works fine, but if you go to domain.com/somepage.html it redirects to www.domain.com/ instead of www.domain.com/somepage.html.
Anyone know why? And how to fix it? Code:
<IfModule mod_rewrite.c> |
Try a full document url for the 404 /
eg: ErrorDocument 404 /404.html or you could use a full url ErrorDocument 404 http://www.someserver.com/404.html |
This is my non-www to www redirection code. Might be of use.
Code:
#WWW Redirect |
Quote:
Quote:
|
Edit: Scratch that... :(
|
You added ! then $ and it worked? cool!$
|
Gah, still not fucking working.
|
Bump, I tried to help. No luck, Kill says he has mod rewrite active. This didn't work:
RewriteCond %{HTTP_HOST} !^www.dom.com$ [NC] RewriteRule ^(.*)$ http://www.dom.com/$1 [R,L] |
It's redirecting the domain properly, but during the redirection, it's killing any actual directory and or pages you have after it.
|
This is what I use:
Code:
RewriteEngine On |
and to add my :2 cents:, this is what I use:
Code:
RewriteEngine on hence the ^domain.com the others use !^www.domain.com which would rewrite subdomain.domain.com which I can't have |
and I will just post so I can find this thread later :)
|
try this
Code:
RewriteCond %{HTTP_HOST} ^([^.]+\.(com|net|org)) [NC] |
should be this actually
Code:
RewriteCond %{HTTP_HOST} ^([^.]+\.(com|net|org)) [NC] |
also try this one
Code:
RewriteEngine On |
fris to the rescue
|
Neither work still, no fucking clue wtf is going on, I'll have to talk to tech at AmeriNOC maybe something with the server I'm on.
|
all of yous are wrong, this is what he wants
Code:
rewritecond %{HTTP_HOST} ^yoursite\.com |
Quote:
|
Thanks for everyones help, but I finally after giving it another whirl today, got it.
Problem? I put the code just below RewriteBase / Code:
<IfModule mod_rewrite.c> |
Hows your Tube script turning out btw?
|
All times are GMT -7. The time now is 05:05 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc