[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 06-26-2006, 08:00 AM   #1 (permalink)
Account Closed
 
Join Date: Mar 2005
Location: East Coast USA
Posts: 840
0.93 NP$ (Donate)

Richieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of light


htaccess Questions-- Help please

One thing I have not spent enough time learning about is the htaccess file....... It is finally biting me in the rump so now I have no choice but to learn about it...

One of my sites, a store actually is using the htaccess to change .html to php basically
-- The site is www.anonlinemall.com
PHP Code:
RewriteEngine On
RewriteRule
^index.html$ index.php

RewriteRule
^(.*)/(.*)-search-(.*)-(.*)-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&$2=$3&Sort=$4&ItemPage=$5 [QSA,L]
RewriteRule ^(.*)/(.*)-search-(.*)-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&$2=$3&Sort=$4 [QSA,L]
RewriteRule ^(.*)/(.*)-search-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&$2=$3 [QSA,L]
RewriteRule ^(.*)/browse-(.*)-(.*)-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&BrowseNode=$2&Sort=$3&ItemPage=$4 [QSA,L]
RewriteRule ^(.*)/browse-(.*)-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&BrowseNode=$2&Sort=$3 [QSA,L]
RewriteRule ^(.*)/browse-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&BrowseNode=$2 [QSA,L]
RewriteRule ^(.*)/(.*).html index.php?Operation=ItemLookup&ItemId=$1 [QSA,L]
RewriteRule ^(.*).html?$ index.php?SearchIndex=$1 [QSA,L]

Everything works fine but now I am trying to add some extra pages that are html... One of the urls I cannot access is www.anonlinemall.com/smoking/

I turn off htaccess and it opens fine......

Can anyone help me out with this. I have tried everything. I know htaccess can be used to redirect and deny ip's etc but I have no idea how to bypass it.......

Thanks...... Who ever answers this question for me I will give 10np's too........ I should say the first person that gives me the info that corrects this problem will get 10np's...



Rich
Richieboy67 is offline  
Old 06-26-2006, 12:22 PM   #2 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
 
Join Date: Feb 2006
Posts: 2,801
56.00 NP$ (Donate)

Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future

Autism Autism Autism Autism Autism Autism Autism
Change:
Code:
RewriteRule ^(.*)/(.*).html index.php?Operation=ItemLookup&ItemId=$1 [QSA,L]
To:
Code:
RewriteRule ^(.*)/(.*).html?$ index.php?Operation=ItemLookup&ItemId=$1 [QSA,L]
edit: Actually I'm not sure about that, but it won't hurt to have it.
I don't see anything else that could be the problem.
Dan is offline  
Old 06-26-2006, 02:13 PM   #3 (permalink)
Senior Member
 
ahtum's Avatar
 
Join Date: May 2006
Posts: 1,266
1,620.58 NP$ (Donate)

ahtum has much to be proud ofahtum has much to be proud ofahtum has much to be proud ofahtum has much to be proud ofahtum has much to be proud ofahtum has much to be proud ofahtum has much to be proud ofahtum has much to be proud ofahtum has much to be proud ofahtum has much to be proud of

Ethan Allen Fund Find Marrow Donors!
Code:
RewriteEngine On
RewriteRule ^index.html$ index.php

RewriteRule ^(.*)/(.*)-search-(.*)-(.*)-(.*).html$ index.php?Operation=ItemSearch&SearchIndex=$1&$2=$3&Sort=$4&ItemPage=$5 [L]
RewriteRule ^(.*)/(.*)-search-(.*)-(.*).html$ index.php?Operation=ItemSearch&SearchIndex=$1&$2=$3&Sort=$4 [L]
RewriteRule ^(.*)/(.*)-search-(.*).html$ index.php?Operation=ItemSearch&SearchIndex=$1&$2=$3 [L]
RewriteRule ^(.*)/browse-(.*)-(.*)-(.*).html$ index.php?Operation=ItemSearch&SearchIndex=$1&BrowseNode=$2&Sort=$3&ItemPage=$4 [L]
RewriteRule ^(.*)/browse-(.*)-(.*).html$ index.php?Operation=ItemSearch&SearchIndex=$1&BrowseNode=$2&Sort=$3 [L]
RewriteRule ^(.*)/browse-(.*).html$ index.php?Operation=ItemSearch&SearchIndex=$1&BrowseNode=$2 [L]
RewriteRule ^(.*)/(.*).html$ index.php?Operation=ItemLookup&ItemId=$1 [L]
RewriteRule ^(.*).html$ index.php?SearchIndex=$1 [L]
this should work

p.s (.*) means $1(variable 1) , for eg in (.*)/(.*).html if you want the second variable (.*)/(.*) you must put
Code:
RewriteRule ^(.*)/(.*).html$ index.php?Operation=ItemLookup&ItemId=$2 [L]
hope i explained right

Last edited by ahtum; 06-26-2006 at 02:17 PM.
ahtum is online now  
Old 06-27-2006, 03:12 PM   #4 (permalink)
Account Closed
 
Join Date: Mar 2005
Location: East Coast USA
Posts: 840
0.93 NP$ (Donate)

Richieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of light


I will try both and get back to you guys later...

I have tried many changes already and so far nothing has worked so hopefully one of these or both will work...

Thanks,

Rich
Richieboy67 is offline  
Old 06-27-2006, 05:33 PM   #5 (permalink)
Account Closed
 
Join Date: Mar 2005
Location: East Coast USA
Posts: 840
0.93 NP$ (Donate)

Richieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of light


Sorry guys, neither of these changes worked for me....... I am not sure if made the changes correctly though.. I am still a bit confused about this but I am learning... I think we are close...

For this

PHP Code:
RewriteRule ^(.*)/(.*).html$ index.php?Operation=ItemLookup&ItemId=$2 [L]
Am I supposed to remove line 10 and replace it with this or just add it???

Thanks so much guys...
Richieboy67 is offline  
Old 06-27-2006, 05:37 PM   #6 (permalink)
Senior Member
 
ahtum's Avatar
 
Join Date: May 2006
Posts: 1,266
1,620.58 NP$ (Donate)

ahtum has much to be proud ofahtum has much to be proud ofahtum has much to be proud ofahtum has much to be proud ofahtum has much to be proud ofahtum has much to be proud ofahtum has much to be proud ofahtum has much to be proud ofahtum has much to be proud ofahtum has much to be proud of

Ethan Allen Fund Find Marrow Donors!
replace it
ahtum is online now  
Old 06-27-2006, 07:41 PM   #7 (permalink)
Account Closed
 
Join Date: Mar 2005
Location: East Coast USA
Posts: 840
0.93 NP$ (Donate)

Richieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of light


I'm sorry but these changes did not work.... Thanks for trying..
Richieboy67 is offline  
Old 06-27-2006, 07:47 PM   #8 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
 
Join Date: Feb 2006
Posts: 2,801
56.00 NP$ (Donate)

Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future

Autism Autism Autism Autism Autism Autism Autism
Code:
RewriteRule ^(.*)/(.*).html index.php?Operation=ItemLookup&ItemId=$1 [QSA,L]
Is the problem. It makes smoking/index.html go to index.php?Operation=ItemLookup&ItemId=smoking

You could make the index of /smoking/ be .php so it won't be affected by the rewrite rules.

I can't figure out any other way to edit the .htaccess right now to fix that.
Dan is offline  
Old 06-27-2006, 08:44 PM   #9 (permalink)
NamePros Regular
 
Jim_'s Avatar
 
Join Date: Aug 2005
Posts: 585
285.40 NP$ (Donate)

Jim_ is a name known to allJim_ is a name known to allJim_ is a name known to allJim_ is a name known to allJim_ is a name known to allJim_ is a name known to all

Save The Children
Code:
RewriteRule ^smoking/(.*).(.*)$ smoking/$1.$2 [L]
Add something like that to the end, maybe? Just an idea.
__________________
ask me about the internet
Jim_ is offline  
Old 07-02-2006, 09:34 AM   #10 (permalink)
Account Closed
 
Join Date: Mar 2005
Location: East Coast USA
Posts: 840
0.93 NP$ (Donate)

Richieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of lightRichieboy67 is a glorious beacon of light


Thanks, I treid that... I have tried tons of things and nothing has worked.

I cannot change the file names because there are just too many...

THanks for trying everyone...
Richieboy67 is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 02:05 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85