NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page htaccess Questions-- Help please

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

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 06-26-2006, 09:00 AM THREAD STARTER               #1 (permalink)
Account Closed
Join Date: Mar 2005
Location: East Coast USA
Posts: 840
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.htmlindex.php

RewriteRule 
^(.*)/(.*)-search-(.*)-(.*)-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&$2=$3&Sort=$4&ItemPage=$[QSA,L]
RewriteRule ^(.*)/(.*)-search-(.*)-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&$2=$3&Sort=$[QSA,L]
RewriteRule ^(.*)/(.*)-search-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&$2=$[QSA,L]
????: NamePros.com http://www.namepros.com/programming/210889-htaccess-questions-help-please.html
RewriteRule ^(.*)/browse-(.*)-(.*)-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&BrowseNode=$2&Sort=$3&ItemPage=$[QSA,L]
????: NamePros.com http://www.namepros.com/showthread.php?t=210889
RewriteRule ^(.*)/browse-(.*)-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&BrowseNode=$2&Sort=$[QSA,L]
RewriteRule ^(.*)/browse-(.*).html index.php?Operation=ItemSearch&SearchIndex=$1&BrowseNode=$[QSA,L]
RewriteRule ^(.*)/(.*).html index.php?Operation=ItemLookup&ItemId=$[QSA,L]
RewriteRule ^(.*).html?$ index.php?SearchIndex=$[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, 01:22 PM   #2 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,796
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.
????: NamePros.com http://www.namepros.com/showthread.php?t=210889
I don't see anything else that could be the problem.
Dan is offline  
Old 06-26-2006, 03:13 PM   #3 (permalink)
Senior Member
 
ahtum's Avatar
Join Date: May 2006
Posts: 1,330
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 03:17 PM.
ahtum is offline  
Old 06-27-2006, 04:12 PM THREAD STARTER               #4 (permalink)
Account Closed
Join Date: Mar 2005
Location: East Coast USA
Posts: 840
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, 06:33 PM THREAD STARTER               #5 (permalink)
Account Closed
Join Date: Mar 2005
Location: East Coast USA
Posts: 840
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 ^(.*)/(.*).htmlindex.php?Operation=ItemLookup&ItemId=$[L
????: NamePros.com http://www.namepros.com/showthread.php?t=210889
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, 06:37 PM   #6 (permalink)
Senior Member
 
ahtum's Avatar
Join Date: May 2006
Posts: 1,330
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 offline  
Old 06-27-2006, 08:41 PM THREAD STARTER               #7 (permalink)
Account Closed
Join Date: Mar 2005
Location: East Coast USA
Posts: 840
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, 08:47 PM   #8 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,796
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, 09:44 PM   #9 (permalink)
NamePros Regular
 
Jim_'s Avatar
Join Date: Aug 2005
Location: NY, USA
Posts: 610
Jim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to behold
 


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, 10:34 AM THREAD STARTER               #10 (permalink)
Account Closed
Join Date: Mar 2005
Location: East Coast USA
Posts: 840
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


Liquid Web Smart Servers  
All times are GMT -7. The time now is 05:58 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger