Htaccess Questions-- Help please

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

Richieboy67

Account Suspended
Impact
6
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:
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
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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.
 
0
Close
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 :red:
 
Last edited:
0
Close
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
 
0
Close
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:
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...
 
0
Close
replace it :)
 
0
Close
I'm sorry but these changes did not work.... Thanks for trying..
 
0
Close
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.
 
0
Close
Code:
RewriteRule ^smoking/(.*).(.*)$ smoking/$1.$2 [L]

Add something like that to the end, maybe? Just an idea.
 
0
Close
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... :)
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back