Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2005-09-07, 02:23 PM   #1
Dravyk
Lord help me, I'm just not that bright
 
Join Date: Apr 2003
Posts: 102
Need Mod Rewrite / Reg Ex Help ASAP

I have a site that already has in a mod_rewrite to turn those long, screwy dynamic strings into short, Search Engine Friendly strings. Problem is, the one I have messes up 10% of the job. It wasn't done completely correctly and there's no support, help or revisions where I got it.

At the moment some archives on the site cannot be accessed because the Reg Ex for that section was apparently done incorrectly in the file that came with it.

Need some help here, free or pay, to be able to have myself, visitors and search engines get into the archives by redoing the erroneous lines correctly.

Need this done quickly as possible! Please hit me up here or by email at dravyk at dirtygloves dot com Thanks!
Dravyk is offline   Reply With Quote
Old 2005-09-07, 03:14 PM   #2
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
post the regexp and I'll take a look
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2005-09-07, 03:31 PM   #3
Dravyk
Lord help me, I'm just not that bright
 
Join Date: Apr 2003
Posts: 102
Thanks, CD34!

Ok, first if you go here (notice this URL isn't SEF'd either) http://www.mainstreamwebmasters.com/...ve&sa=show_all you'll see the categories are fine, the articles are fine.

But go to the bottom of the page and you'll see neither the "next page" link works, nor do the monthly archives links work.

Code:
#*************************************************************************/

DirectoryIndex index.php index.cgi index.pl index.shtml index.html

<Limit GET PUT POST> 
order allow,deny
deny from 209.170.122.151
deny from 80.179.128.
deny from 64.140.49.
allow from all 
</Limit>

# deny most common except .php
<FilesMatch "\.(inc|tpl|h|ihtml|sql|ini|conf|class|bin|spd|theme|module|exe)$">
deny from all
</FilesMatch>

#Disable .htaccess viewing from browser
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</Files>

<Files ~ "\config.php$">
deny from all
</Files>

# change to yoursite.com
ErrorDocument 404 http://www.mainstreamwebmasters.com/404.html

RewriteEngine On 

RewriteRule ^index.html index.php

RewriteRule ^gate.html modules.php

#Articles
RewriteRule ^article([1-9][0-9]*).* gate.html?name=News&file=article&sid=$1
RewriteRule ^article([1-9][0-9]*).html gate.html?name=News&file=article&sid=$1&mode=$2&order=$3&thold=$4
RewriteRule ^topic([1-9][0-9]*)-([0-9]*).* gate.html?name=News&new_topic=$1&pagenum=$2
RewriteRule ^topic([1-9][0-9]*).* gate.html?name=News&new_topic=$1
RewriteRule ^cat([1-9][0-9]*)-([0-9]*).* gate.html?name=News&file=categories&op=newindex&catid=$1&pagenum=$2
RewriteRule ^cat([1-9][0-9]*).* gate.html?name=News&file=categories&op=newindex&catid=$1
RewriteRule ^cat([1-9][0-9]*)-([0-9]*).* gate.html?name=News&file=article&op=newindex&catid=$1&pagenum=$2
RewriteRule ^cat([1-9][0-9]*).* gate.html?name=News&file=article&op=newindex&catid=$1
RewriteRule ^printout([1-9][0-9]*).* gate.html?name=News&file=print&sid=$1
RewriteRule ^newspage([1-9][0-9]*).* gate.html?name=News&pagenum=$1
RewriteRule ^comment([0-9]*)-([0-9]*)-([0-9]*)([a-zA-Z0-9]*)([0-9]*)([/:|\s\-\'{}().&_0-9+=]*).html gate.html?name=News&file=comments&op=showreply&tid=$1&sid=$2&pid=$3&mode=$4&order=$5&thold=$6
RewriteRule ^articles.* gate.html?name=News&file=index

#Search
RewriteRule ^topic([0-9]*).html gate.html?name=Search&topic=$1

#Stories Archive
RewriteRule ^journal.html gate.html?name=Stories_Archive
RewriteRule ^allarticles.html gate.html?name=Stories_Archive&sa=show_all
RewriteRule ^allarticles-([0-9]*).html gate.html?name=Stories_Archive&sa=show_all&min=$1
RewriteRule ^issue([0-9]*)-([0-9]*)-([a-zA-z0-9]*).* gate.html?name=Stories_Archive&sa=show_month&year=$1&month=$2&month_l=$3

#Top10
RewriteRule ^top.html gate.html?name=Top&file=index

#Top Sites
RewriteRule ^addsite.html gate.html?name=Top_Sites&op=AddLink
RewriteRule ^editsite.html gate.html?name=Top_Sites&op=Editlink
RewriteRule ^newsites.html gate.html?name=Top_Sites&op=LastLinks
RewriteRule ^topsiterules.html gate.html?name=Top_Sites&op=rules
RewriteRule ^searchtopsites.html gate.html?name=Top_Sites&op=Searching
RewriteRule ^topsitecategory-([0-9]*).html gate.html?name=Top_Sites&op=index&catid=$1
RewriteRule ^topsites.html gate.html?name=Top_Sites&file=index

#Topics
RewriteRule ^topics.html gate.html?name=Topics

#Your Account
RewriteRule ^userinfo-([/:|\s\-\'{}().&_a-zA-Z0-9+=_-]*).html gate.html?name=Your_Account&op=userinfo&username=$1
Hmm. Also the link on the front index to the Topics isn't SEF'd, nor on the topics page are the categories or the articles SEF'd -- just noticed that. At least they can be gotten to though.

Again, just noticed the Topics thing, the archives though is the important part.

Again, also, much obliged ahead of time if you can be of assistance, CD34.
Dravyk is offline   Reply With Quote
Old 2005-09-07, 04:43 PM   #4
Halfdeck
You can now put whatever you want in this space :)
 
Halfdeck's Avatar
 
Join Date: Oct 2004
Location: New Haven, CT
Posts: 985
Send a message via ICQ to Halfdeck
Wow..huge .htaccess file.

This is probably over my head, but why does your next article url have a dash?

term-.html
__________________
Success is going from failure to failure without a loss of enthusiasm.
Halfdeck is offline   Reply With Quote
Old 2005-09-07, 04:53 PM   #5
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
not only that, there is no rule to deal with ^term- like there is for allarticles-. I would also suspect that based on the allarticles rule, you are missing a page number for the next page so it should probably be term-1 (or perhaps term isn't even correct and it should be allarticles-1)

I would take the allarticles- rule and add

RewriteRule ^term-([0-9]*).html gate.html?name=Stories_Archive&sa=show_all&min=$1

and then see where the code is going wrong that isn't printing the page number.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2005-09-07, 05:01 PM   #6
Dravyk
Lord help me, I'm just not that bright
 
Join Date: Apr 2003
Posts: 102
Quote:
Originally Posted by Halfdeck
Wow..huge .htaccess file.

This is probably over my head, but why does your next article url have a dash?

term-.html
Precisely. It's replacing something wrong.

Btw, I found something important that might help anyone trying to figure this thing out. That is, what are the normal URLs from the program and what is it replacing it with.

So I dug some digging and this is what I came up with:

Dravyk is offline   Reply With Quote
Old 2005-09-07, 05:05 PM   #7
Dravyk
Lord help me, I'm just not that bright
 
Join Date: Apr 2003
Posts: 102
Quote:
Originally Posted by cd34
not only that, there is no rule to deal with ^term- like there is for allarticles-. I would also suspect that based on the allarticles rule, you are missing a page number for the next page so it should probably be term-1 (or perhaps term isn't even correct and it should be allarticles-1)

I would take the allarticles- rule and add

RewriteRule ^term-([0-9]*).html gate.html?name=Stories_Archive&sa=show_all&min=$1

and then see where the code is going wrong that isn't printing the page number.
Added that line. No change though.

Addenum: The line looks the same. It is now clickable, but instead of showing the next 250 it's oddly showing a single article, huh?
Dravyk is offline   Reply With Quote
Old 2005-09-07, 10:33 PM   #8
Dravyk
Lord help me, I'm just not that bright
 
Join Date: Apr 2003
Posts: 102
Hey appreciate the help folks!

Just wanted to say someone I know saw this thread, contacted somebody they knew, who then got in touch with me -- and things are about 98% fixed now (probably would have been 100% but I had to run out on already pushed-back errands.)

Turns out it was a combination of both the mod rewrite being wrong as well as -- once it was made correctly -- something in the script itself then would not pass along some of the variables (like &month=x etc) correctly either. So a module .php file had to be altered in a couple of places as well.

Again, funny thing is this was the Nuke Googlfier one gets at the site. It just didn't do everything it was supposed to do.
Dravyk is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:12 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc