• Welcome to New Hampshire Underground.
 

News:

Please log in on the special "login" page, not on any of these normal pages. Thank you, The Procrastinating Management

"Let them march all they want, as long as they pay their taxes."  --Alexander Haig

Main Menu

New Hampshire Free Press site broken

Started by Bill St. Clair, May 01, 2009, 06:40 AM NHFT

Previous topic - Next topic

Bill St. Clair

For a couple of days now, the New Hampshire Free Press site, http://nhunderground.com/NHFreePress/ , has displayed with everything down one column, instead of nicely laid out. Also, links to other places in the site don't work, only the home page. I figured it out today. All the links in the page source start with a "/", meaning that they look for their target at the top-level of the site, instead of in the NHFreePress directory. My guess is that somebody changed the mod-rewrite rules in the .htaccess file, and that broke stuff, but it's hard to tell without being able to see the php and the .htaccess file.

Bill St. Clair

Duh. If I use the proper address for the site, http://newhampshirefreepress.com/ , it works fine.

As Emily Latella used to say, "Never mind."

It would be nice if the wrong address, in my first post, auto-forwarded to the right address.

Kat Kanning


Kat Kanning

Anyone know why this isn't working anymore?  Trying to forward newhampshirefreepress.com/NHFreePress -> newhampshirefreepress.com

RewriteEngine on
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^NHFreePress\/?$ "http\:\/\/newhampshirefreepress\.com\/" [R=301,L]

bile

RewriteEngine on
RewriteRule ^NHFreePress/(.*)$ http://newhampshirefreepress.com/$1 [R=301,L]
RewriteRule ^NHFreePress$ http://newhampshirefreepress.com/ [R=301,L]


not sure why it would just stop working... perhaps the host changed something.

Mike Barskey

I don't think it stopped working. I think she wants to add a new forward, so that people who mistakenly enter the wrong URL get forwarded to the correct one.

If it did stop working, however, it was probably something I did (I manipulated some files on their recently). I don't think that's the case, though. After I fixed what I screwed up a few weeks ago, I tested the old forward (nhunderground.com/nhfreepress -> newhampshriefreepress.com) and it worked fine, and it still works fine.

Looking at Site5's admin interface (where this domain is hosted), they offer a GUI to forward from the nhunderground.com domain, but you must enter your own apache mod_rewrite rules (as Kat did) to do any other forwarding.

So I don't know why her rewrite rule is not working. Maybe it depends on where the .htaccess file is located?

Kat Kanning

It was working before.

.htaccess is located in /public_html

Kat Kanning

Oh, I have the forward there because all the old links on the internet point to /NHFreePress directory.  I'd like the old links to work.

bile

What I posted should work but if there is a cpanel gui or something that makes it easier that'd probably be a safer bet.

Mike Barskey

Quote from: Kat Kanning on May 14, 2009, 04:49 AM NHFT
It was working before.

.htaccess is located in /public_html
...
Oh, I have the forward there because all the old links on the internet point to /NHFreePress directory.  I'd like the old links to work.

I may be misunderstanding what the current problem is. Are you saying that the old links are like: http://newhampshirefreepress.com/NHFreePress/node/1 ? I thought the old link were like: http://nhunderground.com/NHFreePress/node/1 .

Where can I find one of the old links?

Quote from: bile on May 14, 2009, 05:02 AM NHFT
What I posted should work but if there is a cpanel gui or something that makes it easier that'd probably be a safer bet.

The CPanel gui only makes it easy to add forwards to the nhunderground.com domain. If you want to add forwards to other domains, I think you have to do it the way you are doing it, in the .htaccess file.


bile

What I posted originally is exactly that.

Mike Barskey

Kat, is it working how you want it to, now?

Kat Kanning

Yes.  Remind me to give you a big hug next time I see you.  :D  Thanks!!!

Mike Barskey

Woohoo! Free Kat hug!

For the record, in case this happens again: I placed Bile's RewriteRules in the .htaccess file that's in the NHFreePress directory. That .htccess file also has some other RewriteRules for Drupal.