Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: Redirect problems... Help ?  (Read 2325 times)

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Redirect problems... Help ?
« on: December 19, 2006, 09:23:19 am »

Hi folks... I'm a fan of no-www.org. I find this prefix of no use, so therefor I redirect my domains from www.xxx.com to xxx.com by doing this (in the .htaccess):
Quote from: Patric
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.p-ahlqvist\.com$ [NC]
RewriteRule ^(.*)$ http://p-ahlqvist.com/$1 [R=301,L]
Now this works fine on my default site, the root. However... I am doing a subsite, with a new domain name to it, as in root/subfolder. In that I have this new site, and it's own .htaccess file (this is not snews driven) and I add the same thing in order to get it from 3W to no-www (changing the URL though ;) )... But this don't work it seems... This is what I would like help with. Anyone with insight in these matters ?

Patric.
Logged
"It's only dead fish that goes with the flow... "
Updated

Mika

  • Hero Member
  • *****
  • Karma: 9
  • Posts: 1377
    • http://www.ni5ni6.com/
Redirect problems... Help ?
« Reply #1 on: December 19, 2006, 09:33:38 am »

more reading: http://enarion.net/web/apache/htaccess/redirect-www-and-no-www/

try this
Quote
RewriteCond %{HTTP_HOST} ^www\.p-ahlqvist\.com/folder$ [NC]
RewriteRule ^(.*)$ http://p-ahlqvist.com/folder/$1 [R=301,L]
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Redirect problems... Help ?
« Reply #2 on: December 19, 2006, 09:42:26 am »

Thanks mate... will read ! As for the second part... Would that work you think. I might have missed out in the explainations. I mean to have this folder under a new domain name... Say I wanna call that: h ttp://pakao.com (hehe ;) ) meaning that I would like to redirect from w ww.pakao.com to pacao.com... Would the snippet above do that as I enter my base URL/folder ? I know nooooothing.

Can't access the .htaccess from work, have to try it out when I get home...
Logged
"It's only dead fish that goes with the flow... "
Updated