We’d like to remind Forumites to please avoid political debate on the Forum.
This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
Redirect php/html confusion

JooFox
Posts: 111 Forumite
in Techie Stuff
Evening everyone. I'm a real n00b with html and css, and here is what I would like to do...
I have a site where by default an online shop opens with products shown in a view that I don't like. I want the default to be as a list. When I click the list button, this is shown in the address bar:-
http://website.com/MusicShop/index.php?cPath=11
I wondered how I could add a redirect in website.com/shop to go straight to:-
http://website.com/MusicShop/index.php?cPath=11
I have tried index.php and .htaccess redirects but they just go to the view I don't want.
Any help would be hugely appreciated :-)
I have a site where by default an online shop opens with products shown in a view that I don't like. I want the default to be as a list. When I click the list button, this is shown in the address bar:-
http://website.com/MusicShop/index.php?cPath=11
I wondered how I could add a redirect in website.com/shop to go straight to:-
http://website.com/MusicShop/index.php?cPath=11
I have tried index.php and .htaccess redirects but they just go to the view I don't want.
Any help would be hugely appreciated :-)
0
Comments
-
Not sure what you are asking here ..
This is a site that you created right ??
You are sending a GET of cPath=11 to the index.php file, so somewhere in there your php script is reading this and doing the action that you want ..
Simply change it so that the action you want is the default behaviour.
So in the line that assigns a variable with the value of cPath when reading the GET, just add a line that equates to .. if (variable == '') variable=11;0 -
There should be an option in the settings of the shop to default to a particular view, which sounds like is what's happening here. If you change it there in the settings it should default to that and you wouldn't need htaccess.0
This discussion has been closed.
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 351.7K Banking & Borrowing
- 253.4K Reduce Debt & Boost Income
- 454K Spending & Discounts
- 244.7K Work, Benefits & Business
- 600.1K Mortgages, Homes & Bills
- 177.3K Life & Family
- 258.4K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.2K Discuss & Feedback
- 37.6K Read-Only Boards