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: htaccess and bad links  (Read 1661 times)

Brian

  • Guest
htaccess and bad links
« on: January 19, 2007, 08:18:54 pm »

I'm in the process of moving a website to a new hosting provider and unfortunately have ran into a few snags with htaccess and it's redirects. For some reason, my links will be re-written so that the URL is what is currently in my brower's URL.  Everything is fine when your on the main page -- it's only when you drill down into a story.

So if you drill into a story and your URL shows "http://website/home/this_is_a_test_story" then all the links on the page (not snews related) will be changed to "http://website/home/this_is_a_test_story/linking_object.html".  

My htaccess is the original one that came with sNews 1.4
Code: [Select]

php_value session.use_trans_sid 0


RewriteEngine On
RewriteRule ^categories/$ index.php?category=categories [L,QSA]
RewriteRule ^contact/$ index.php?category=contact [L,QSA]
RewriteRule ^images/$ index.php?category=images [L,QSA]
RewriteRule ^login/$ index.php?category=login [L,QSA]
RewriteRule ^logout/$ index.php?category=logout [L,QSA]
RewriteRule ^new/$ index.php?category=new [L,QSA]
RewriteRule ^rss/$ index.php?category=rss [L,QSA]
RewriteRule ^unpublished/$ index.php?category=unpublished [L,QSA]

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ index.php?category=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_]+)/([^/]+)/ index.php?category=$1&title=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_]+)/([^/]+)/([^/]+)/ index.php?category=$1&title=$2&commentspage=$3 [L]
I've tried different modifications, including RewriteBase, commenting various things out and even trying to setup RewriteRules specifically to get around it, with zero luck.

What is strange is that this has worked fine on both the old host and two of my internal servers without any fuss, so I am guessing my hosting provider has something setup differently.

Any help will be appreciated :)

Brian
Logged