![]() |
| Home | Demo | Services | Features | Help | User Forum | Blog | About | |
|
#1
|
|||
|
|||
|
This is a 301 redirect i was trying to do in my htaccess file, unfortunately it doesnt work and i cant figure out why
Quote:
__________________
mens grooming, shaving and health |
|
#2
|
||||
|
||||
|
It's because of the query string.
You need the mod rewrite module. You need to test the query string and redirect that way. Can't test it now though, I need to be at home. Try thsi: Quote:
__________________
Christina >>Forum Moderator<< Please do not PM me for support. The forum is here for that. |
|
#3
|
|||
|
|||
|
I once tried using a regular 301 for a php query, found out it didn't work. And that was all I really needed to know.
When I started working on my own self-coded php project, I made sure I built in an automatic 301 redirect... Regardless, I'll have to keep Christina's advice in mind! I might still need that one day... |
|
#4
|
|||
|
|||
|
okay i've been playing around with this for hours and i'm beginning to think i'm out of depth
is it normal for different types of browser to interpret htaccess files in different ways, i managed to get the coding you gave me (thanks for that Christina) working but only in explorer and using the pointers you gave me i got this: Quote:
im stuck can anybody give me anymore pointers in why i'm messing up.
__________________
mens grooming, shaving and health |
|
#5
|
||||
|
||||
|
That's not what I gave you. I gave you directives based on the query string. Did you try it as I gave it?
Not saying it works because it doesn't actually. But this is the kind of thing that needs to be done, along those lines. Browsers do not interpret .htaccess, they are unaware of it completely. The server acts on its directives regardless of browser or user agent unless the .htaccess fiel has directives based on user agent - I doubt you got any of those. The only differences I can see between FF and IE would be that in FF it's easy to suppress referrer with the developer toolbar, but there's no such option in IE I'm aware of. Again this would only matter if your .htaccess tests the referrer, which is doesn't. So I'll keep on thinking because I too need an .htaccess solution for this if it's possible at all. In the meanwhile I am handling a similar situation with a bit of php code at the top of index.php that tests the query string part by testing $_SERVER['REQUEST_URI'] (NB: not the php variable $_SERVER['QUERY_STRING']), isolating the string between ? and end of the string, testing that, and then do a 301 redirect to wherever if it matches. Here is where I am testing: client.webado.net/seth/ And this is the script I put at the top of my index.php : Quote:
__________________
Christina >>Forum Moderator<< Please do not PM me for support. The forum is here for that. Last edited by webado; 09-01-2007 at 08:19 PM. |
|
#6
|
|||
|
|||
|
the original code you gave me worked in firefox but no joy in explorer, i used what you said and searched google under mod rewrite, thats how i developed the second code, (it doesnt work either)
i also found a blog which said htaccess was all voodoo which is beginning to sound plausible so do i need to stick closer to the original code you gave me, i'll go back and start searching again, thanks Christina
__________________
mens grooming, shaving and health |
|
#7
|
||||
|
||||
|
Until you or I find it, do what I just did above.
The problem with the code I gave for .htaccess is that it does not chop the query string, it tacks it onto the new url where you are redirecting. I need the bit of voodoo to know how to get rid of that. I am getting a headache from reading the Apache manual on this.
__________________
Christina >>Forum Moderator<< Please do not PM me for support. The forum is here for that. Last edited by webado; 09-01-2007 at 08:23 PM. |
|
#8
|
||||
|
||||
|
I FOUND IT!
Quote:
__________________
Christina >>Forum Moderator<< Please do not PM me for support. The forum is here for that. |
|
#9
|
|||
|
|||
|
ha ha that works, Christina you are a babe
i got hundreds of those old php pages this is gonna clear up thousands of 404 errors a month Christina you are without doubt my favorite online imaginary friend, thanks babe youre great
__________________
mens grooming, shaving and health |
|
#10
|
||||
|
||||
|
Quote:
Oooooh, Seth, you make me blush! But hundreds? Yikes, you're gonna have a lot of lines in your .htaccess file. You'll need some automation whether you use .htaccess or scripting methinks. Basically this does externally the opposite of what your url rewriting does internally. Do you have your current internal url rewriting automated in any way? Or did you add them all manually to your .htaccess file?
__________________
Christina >>Forum Moderator<< Please do not PM me for support. The forum is here for that. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|