Halfagain IM Forums
February 10, 2012, 02:03 *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Due to increasing spam we are forced to make this forum "Read Only". If you have an issue, most likely was discussed here. Use the Search function and try to find related discussions. If you can't find any helpful information, just email support at halfagain dot com"
 
   Home   Help Login Register  
Pages: [1] 2
  Print  
Author Topic: 404 Error for existing Files  (Read 5626 times)
0 Members and 2 Guests are viewing this topic.
Neo
Newbie
*

Karma: 10
Offline Offline

Posts: 2


« on: April 08, 2008, 23:21 »

Hi,
I have installed storestacker in the root of my exisitng site. My plan was to build a store at the root of the domain and keep the exisitn g content pages under subfolders. But now all the other exisiting pages is giving me a 404 error. (including the files under the root of the domain as well as in the subfolder)


Also, is it possible to add a custom 404 page?
Logged
HT_Parker
Newbie
*

Karma: 10
Offline Offline

Posts: 53


« Reply #1 on: April 09, 2008, 01:10 »

I was thinking my redirects were not working but this might be the same issue. I have hostgator support looking into the redirect problem as I type.  They were unable to correct problem. Most likely the script doing something.
« Last Edit: April 09, 2008, 01:15 by HT_Parker » Logged

Omar
Here to help.
Administrator
Hero Member
*****

Karma: 10001
Offline Offline

Posts: 2687


« Reply #2 on: April 09, 2008, 10:59 »

You will need some modification to htaccess if you plan to put other folders inside a sst install, beside the script folders. So for each folder you create you have to add one more line after RewriteBase /

Lines will look like below, based on what folders you create

RewriteRule   ^blog(.*)$     -     [L]
RewriteRule   ^images(.*)$     -     [L]
RewriteRule   ^some-fodler-name(.*)$     -     [L]
RewriteRule   ^etc(.*)$     -     [L]
...
and then comes the rest of lines. keep it intact.

If you add files and not folder, the lines to allow access to a file is similar but a bit different too:

RewriteRule   ^somefile\.php$ - [L]
RewriteRule   ^anotherfile\.html$ - [L]
RewriteRule   ^somescriptfile\.js$ - [L]
...
« Last Edit: September 14, 2008, 08:19 by Omar » Logged
HT_Parker
Newbie
*

Karma: 10
Offline Offline

Posts: 53


« Reply #3 on: April 09, 2008, 14:32 »

Will this fix the redirect problem as well?

That means I have to list every folder I have on that site (which is 35-70 or so) just to redirect the ones I want redirected to a store page. :eek:

But if that's the answer that's the answer.
Logged

HT_Parker
Newbie
*

Karma: 10
Offline Offline

Posts: 53


« Reply #4 on: April 09, 2008, 16:03 »

Ok, all this does is causes the system to bring up the
standard 404 page instead of a 404 page using the store
template. Something is still blocking the redirect. :confused:
 
If this was a new site I would care but I know its getting hits and
spider visits from the old site and I want to redirect them to the
appropriate store category / product page. Sad
« Last Edit: April 09, 2008, 16:27 by HT_Parker » Logged

davey
Newbie
*

Karma: 10
Offline Offline

Posts: 56


« Reply #5 on: April 10, 2008, 05:13 »

HT_Parker I am doing something similar on a site and it appears I got it too work.

Note - I am by no means an expert at mod rewrite and this may cause other problems I am not aware of, but it does appear to be working.

Note that Omar says to add it after RewriteBase /, for something similar it only worked for me if I put it after RewriteEngine On BUT before RewriteBase / - Don't know why.

This was to get my header to show up which is in the /images folder - so to get me image to show up I did this:

RewriteEngine On
RewriteRule ^images/imagename\.jpg$ - [L]
RewriteBase /


To get my original files to not be a 404 in SS added this:

RewriteEngine On
RewriteRule ^images/imagename\.jpg$ - [L]
RewriteRule ^filename\.htm$ - [L]
RewriteBase /


That made it so the original file shows up instead of a 404 - Since you are using folders you RewriteRule will need to be a little different.

Now to get the the original file (folder in your case) to redirect to the new page of SS add this or something like it to the bottom of your htacess file after all the mod rewrite stuff

redirect 301 /filename.htm http://www.yourdomain.com/pages/newfilename.html


This is working for me.  If anyone sees any issues please post.
Logged

HT_Parker
Newbie
*

Karma: 10
Offline Offline

Posts: 53


« Reply #6 on: April 10, 2008, 15:32 »

Thanks Davey!
That gives me instant traffic. Cheesy
 
Now, let see if they are buying. Wink
Logged

davey
Newbie
*

Karma: 10
Offline Offline

Posts: 56


« Reply #7 on: April 11, 2008, 03:32 »

Cool - Glad I could help!
Logged

CloakAndDagger
Jr. Member
**

Karma: 10
Offline Offline

Posts: 164


WWW
« Reply #8 on: April 11, 2008, 19:04 »

Well they need to inject this into the SS
Logged

http://www.novasoft-inc.com/hop.asp?pid=15&aid=760 Is Blogger deleting your blogger accounts faster than you can build em?  Or try this http://www.novasoft-inc.com/hop.asp?pid=6&aid=760In Just 5 Minutes You Can Have Hundreds of Talented Writers Doing All The Work To Keep Your BLOGS Filled With The Latest News, Articles, And Information, And It Won't Cost You A Dime!
Omar
Here to help.
Administrator
Hero Member
*****

Karma: 10001
Offline Offline

Posts: 2687


« Reply #9 on: April 12, 2008, 09:08 »

Quote from: CloakAndDagger
Well they need to inject this into the SS


How do you think SS can know what other pages or files you or some1 else have or will upload on that domain?! The code davey posted, and that i posted too, is tied to specific file names or folder names.
Logged
jjarrett
Newbie
*

Karma: 100
Offline Offline

Posts: 64



WWW
« Reply #10 on: April 16, 2008, 17:41 »

I used the code but forgot to delete the .htaccess in the directory I was working on. It didn't work. I deleted the old .htaccess in that directory, and it works now. Thank you.

I do still have a problem though: The API in the directory under store stacker where my membership site is isn't working so no one can sign up as a new member.

Any ideas on how to fix this?

I did contact my web host because he wrote the script, but I haven't heard anything back yet. Maybe it's a host wide problem.

Anyway, any suggestions you have would be great, and again, I really appreciate your help.

Jinger
Logged

How to Make Money Online Without a Website, a List, or Expensive Pay Per Click campaigns. Learn the simple online strategies I use to to earn thousands every month marketing with classified ads. Free Marketing With Classifieds Ebook
Omar
Here to help.
Administrator
Hero Member
*****

Karma: 10001
Offline Offline

Posts: 2687


« Reply #11 on: April 16, 2008, 21:11 »

SS can only influence a directory only if that directory is inside the SS folder or if SS was installed in the root and that directory was already in the root.

Htaccess editing will solve the problem in both cases.
Logged
Crazeet
Jr. Member
**

Karma: 100
Offline Offline

Posts: 100


« Reply #12 on: May 03, 2008, 13:28 »

Quote
How do you think SS can know what other pages or files you or some1 else have or will upload on that domain?!
You couldn't, but from the other side of the coin, how were we suppose to know that the SS .htaccess took such control?

Right now I am having a problem trying to figure out what to add to the .htaccess file. I've added a folder that has it's own folders that has many php files and and it's own config.inc.php I've tried adding the folders after RewriteBase / as per the some-fodler-name in the below
Quote
Lines will look like below, based on what folders you create

RewriteRule ^blog(.*)$ - [L]
RewriteRule ^images(.*)$ - [L]
RewriteRule ^some-fodler-name(.*)$ - [L]
RewriteRule ^etc(.*)$ - [L]
...
and then comes the rest of lines. keep it intact.
My .htaccess is
Quote
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteRule ^generator(.*)$ - [L]
RewriteRule ^data(.*)$ - [L]
RewriteRule ^pages(.*)$ - [L]
RewriteCond %{REQUEST_URI} ^[^\.]*[^/]$
RewriteRule (.+) $1/ [R,L]
RewriteCond %{REQUEST_URI} !^/index\.php|^/admin|^/click\.php|^/templates/|^/install\.php|^/robots\.txt$|^/favicon\.ico
RewriteRule (.+) index.php?req=$1&%{QUERY_STRING}


I can load the index.php in the main folder (generator) I've added but when I run the script in it (that adds other pages) I end up with the 404 error.

What else do I need to add?
« Last Edit: May 03, 2008, 13:41 by Crazeet » Logged

"The only place success comes before work is in the dictionary"
The Inspiration Place
Scents ul Wear
Omar
Here to help.
Administrator
Hero Member
*****

Karma: 10001
Offline Offline

Posts: 2687


« Reply #13 on: May 04, 2008, 09:53 »

Quote
I can load the index.php in the main folder (generator) I've added but when I run the script in it (that adds other pages) I end up with the 404 error.


What exactly is your script trying to do? Not all kind of scripts are possible to be used together with other scripts, no matter what those scripts are.
Logged
Crazeet
Jr. Member
**

Karma: 100
Offline Offline

Posts: 100


« Reply #14 on: May 05, 2008, 08:24 »

Hi Omar,
Quote
What exactly is your script trying to do? Not all kind of scripts are possible to be used together with other scripts, no matter what those scripts are.
I'm sending more info in a PM.
Logged

"The only place success comes before work is in the dictionary"
The Inspiration Place
Scents ul Wear
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!