Author Topic: 404 weirdness  (Read 4081 times)

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14305
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
404 weirdness
« on: May 07, 2012, 12:31:26 PM »
So one of my clients likes to setup URLs like: www.example.com/whatever and that then redirects to the correct page so he can do targeted ads and give people simple URLs to remember.  I had it working at one point but I went to add a new one this morning and it's not working.

Keep in mind that his site is setup like this:

root (nothing here)
   - site (actual public site)
   - dev site (where I work mainly)

This is the .htaccess from the root:
Code: [Select]
RewriteEngine on

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName americanbeautytools.com

ErrorDocument 404 /site/404.php
RewriteCond %{HTTP_HOST} ^solderingsolutions.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.solderingsolutions.com$
RewriteRule ^(.*)$ "https\:\/\/www\.americanbeautytools\.com" [R=301]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [NC,L]
RewriteRule ^models/([a-z]+)/([0-9]+)/([a-z]+)$ /site/index.php?req=prod&cat=$1&model=$2&show=$3 [NC,L]
RewriteRule ^models/([a-z]+)/([0-9]+)$ /site/index.php?req=prod&cat=$1&model=$2 [NC,L]
RewriteRule ^models/([a-z]+)$ /site/index.php?req=prodcat&cat=$1 [NC,L]
RewriteRule ^([a-z]+)/([a-zA-Z0-9\-]+)$ /site/index.php?req=$1&action=$2 [NC,L]
RewriteRule ^([a-z]+)$ /site/index.php?req=$1 [NC,L]

This is the .htaccess from the site folder:
Code: [Select]
ErrorDocument 404 /404.php

RewriteEngine on
RewriteCond %{HTTP_HOST} ^americanbeautytools.com$ [NC]
RewriteRule ^(.*)$ https://www.americanbeautytools.com/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [NC,L]
RewriteRule ^models/([a-z]+)/([0-9]+)/([a-z]+)$ /site/index.php?req=prod&cat=$1&model=$2&show=$3 [NC,L]
RewriteRule ^models/([a-z]+)/([0-9]+)$ /site/index.php?req=prod&cat=$1&model=$2 [NC,L]
RewriteRule ^models/([a-z]+)$ /site/index.php?req=prodcat&cat=$1 [NC,L]
RewriteRule ^([a-z]+)/([a-zA-Z0-9\-]+)$ /site/index.php?req=$1&action=$2 [NC,L]
RewriteRule ^([a-z]+)$ /site/index.php?req=$1 [NC,L]

And this is the 404.php page I have under site:
Code: [Select]
<?php
if(strpos(strtolower($_SERVER['REQUEST_URI']), 'modeler') !== false || strpos(strtolower($_SERVER['REQUEST_URI']), 'modeller') !== false)
header("Location: https://www.americanbeautytools.com/site/hobby");
elseif(
strpos(strtolower($_SERVER['REQUEST_URI']), 'inhouse') !== false)
header("Location: https://www.americanbeautytools.com/site/test");
elseif(
strpos(strtolower($_SERVER['REQUEST_URI']), 'tips') !== false)
header("Location: https://www.americanbeautytools.com/site/models/st");
elseif(
strpos(strtolower($_SERVER['REQUEST_URI']), 'repair') !== false)
header("Location: https://www.americanbeautytools.com/site/repair");
 elseif(
strpos(strtolower($_SERVER['REQUEST_URI']), 'ergo') !== false)
header("Location: https://www.americanbeautytools.com/site/models/ei");
elseif(
strpos(strtolower($_SERVER['REQUEST_URI']), 'inhouse') !== false || strpos(strtolower($_SERVER['REQUEST_URI']), 'in-house') !== false || strpos(strtolower($_SERVER['REQUEST_URI']), 'freeinhouse') !== false || strpos(strtolower($_SERVER['REQUEST_URI']), 'fite') !== false)
header("Location: https://www.americanbeautytools.com/site/test");
else
header("Location: https://www.americanbeautytools.com/site");
?>


Granted, I'm sure I could probably reduce some of the stuff in the root .htaccess file (I probably don't need to do any url rewriting at that level), but what am I doing wrong?

I only about half know how the .htaccess files work which is probably abundantly clear from how they're setup.

Please help me.   :(

KnuckleBuckett

  • Jackass In Charge
  • Posts: 8674
  • Karma: +26/-259
  • [url=http://google.com]I search a lot[/url]
Re: 404 weirdness
« Reply #1 on: May 07, 2012, 11:41:37 PM »
Any luck?

I had no idea you did work for American Beauty.


micah

  • A real person, on the Internet.
  • Ass Wipe
  • Posts: 6915
  • Karma: +58/-55
  • Truth cannot contradict truth.
    • micahj.com
Re: 404 weirdness
« Reply #2 on: May 08, 2012, 08:57:41 AM »
I had no idea you did work for American Beauty.

remember a while back, he posted about that menu system; the functionality of which is pretty sweet.

"I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.  I use it to look at pictures of cats and get in arguments with strangers."

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14305
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Re: 404 weirdness
« Reply #3 on: May 08, 2012, 09:17:52 AM »
Any luck?

I had no idea you did work for American Beauty.
I didn't work last night so I haven't had more time to look at it.

Did you know about them?  Have you been to the site before?  I just updated the product pages with new menus yesterday ;)

KnuckleBuckett

  • Jackass In Charge
  • Posts: 8674
  • Karma: +26/-259
  • [url=http://google.com]I search a lot[/url]
Re: 404 weirdness
« Reply #4 on: May 08, 2012, 10:10:15 AM »
I do know of them.  AB supposedly makes some of the highest quality soldering irons available.

The Air Force guy who trained me back in the day swore by them.  He always disliked the PACE and Weller products that the Lab stocked.

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: 404 weirdness
« Reply #5 on: May 08, 2012, 11:44:24 AM »
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14305
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Re: 404 weirdness
« Reply #6 on: May 08, 2012, 12:04:49 PM »
Cool shit.  :)  Ok, so I don't want to derail the thread, but what do you guys think of the site?

micah

  • A real person, on the Internet.
  • Ass Wipe
  • Posts: 6915
  • Karma: +58/-55
  • Truth cannot contradict truth.
    • micahj.com
Re: 404 weirdness
« Reply #7 on: May 08, 2012, 12:22:11 PM »
I like the menu implementation on the home page.

Overall, I like the site although it seems a little blocky and the solid dark colors make it feel a little gloomy.  I don't claim to be a designer though so feel free to take that with a grain of salt.

The product detail pages, though nice on their own, seem disconnected from the homepage and higher tier pages.
"I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.  I use it to look at pictures of cats and get in arguments with strangers."

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14305
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Re: 404 weirdness
« Reply #8 on: May 08, 2012, 01:56:42 PM »
Yeah, it's a little blocky.  I won't disagree with that.  It is a little dark but the logo is a little dark so I didn't have a lot to work with.

And no disagreement on the product pages.  It is a completely different look and that's not completely unintentional.  The idea is to get them down into a product and push them further down the sales funnel.  Not sure if it actually works, but that was the intention.

KnuckleBuckett

  • Jackass In Charge
  • Posts: 8674
  • Karma: +26/-259
  • [url=http://google.com]I search a lot[/url]
Re: 404 weirdness
« Reply #9 on: May 08, 2012, 04:27:28 PM »
Cool shit.  :)  Ok, so I don't want to derail the thread, but what do you guys think of the site?

I noticed that this page has scaling issues with the text around the photo.

"Today, we've made the power of resistance available to everyone.  Over the years, we ..."

https://www.americanbeautytools.com/site/index.php?req=hobby&app=1

Try ctrl +/- in chrome.

Also they need to advertise their master level build quality.  I would consider making it Master Quality Soldering Solutions or some such.


ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14305
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Re: 404 weirdness
« Reply #10 on: May 08, 2012, 04:34:45 PM »
Ha, weird.  The owner controls that content, but I could tweak it slightly.  Not sure what you mean by the last statement?

KnuckleBuckett

  • Jackass In Charge
  • Posts: 8674
  • Karma: +26/-259
  • [url=http://google.com]I search a lot[/url]
Re: 404 weirdness
« Reply #11 on: May 08, 2012, 08:24:21 PM »
Ha, weird.  The owner controls that content, but I could tweak it slightly.  Not sure what you mean by the last statement?

Their spot in the market is peerless quality.  When you go to their site this should be immediately obvious to potential customers.

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14305
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Re: 404 weirdness
« Reply #12 on: May 08, 2012, 08:46:47 PM »
I'll pass that insight along to him.  Thanks!

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14305
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
Re: 404 weirdness
« Reply #13 on: May 08, 2012, 09:28:41 PM »
By the way, I figured this out.  Fuck the custom 404 page.  I like using htaccess more anyways:
Code: [Select]
RewriteRule ^ergo$ /site/models/ei [NC,L]
RewriteRule ^modeler$ /site/hobby [NC,L]
RewriteRule ^modeller /site/hobby [NC,L]
RewriteRule ^inhouse$ /site/test [NC,L]
RewriteRule ^in-house$ /site/test [NC,L]
RewriteRule ^freeinhouse$ /site/test [NC,L]
RewriteRule ^fite$ /site/test [NC,L]
RewriteRule ^inhouse$ /site/test [NC,L]
RewriteRule ^tips$ /site/models/st [NC,L]
RewriteRule ^repair$ /site/repair [NC,L]

Using the rewrite, it retains the same URL they put in which is an added bonus.

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
Re: 404 weirdness
« Reply #14 on: May 08, 2012, 09:30:44 PM »
I had no idea they were so advanced and popular, i just like the bent soldering iron
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?