Forum Moderators: phranque
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Thanks,
Jim
RewriteRule ^/subdirectory2/(.*)$ [domain.com.com...] [R=301,L]
I am trying something like this, everything after the subdirectory 2 name and then redirecting to the new url WITHOUT the subdirectory2 in it, but it doesnt seem to be working.
I am editing the .htaccess in the subdirectory1 directory since subdirectory 2 (which was under subdirectory 1) no longer exists.
I also have a ErrorDocument 404 [domain.com...]
When I try to
[domain.com...]
it sends me to the errordocument 404 url
RewriteRule [b]^sub[/b]directory2/(.*)$ http://www.example.com.com/subdirectory1/$1 [R=301,L]
ErrorDocument 404 /subdirectory1/
Note that if you intentionally remove resources from your site, the URLs for those resources should return a 410-Gone response, since 404-Not Found means "The requested resource is missing for an unknown reason" and could be due to either a client error, a Webmaster error, or a server error. 410-Gone says "This resource was intentionally removed and will not return -- At least not any time soon." In order to return a 410-Gone status, you must add code that detects the URLs of removed resources, and produces the 410 response accordingly.
Jim
/subdirectory1/subdirectory2/
then you could use a rewrite (instead of a redirect) to allow URLs like www.example.com/subdirectory1/ to access that content.
The links on the pages must also be changed to call those www.example.com/subdirectory1/ URLs too.
Description : Unknown column '26js' in 'where clause'
Request URI: /x/product.php?productid=1402%2526js=n
%2526 should be the & sign, so it should be /x/product.php?productid=1402&js=n
Another example of this is
Description : Unknown column '26cat' in 'where clause'
Request URI: /x/product.php?productid=1062%2526cat=110%2526page=1
Backtrace:
It should be (there are 2 instances of %2526 in the example above)
/x/product.php?productid=1062&cat=110&page=1
I assume the previous rewrite should retain the & sign as an & sign and not convert it to the equivalent of %2526
This is really bogging down my sql processes, can I make another rewrite to capture the %2526 and convert it to an & sign
Does it get amended to the END of the rewrite of
RewriteRule ^subdirectory2/(.*)$ http://www.example.com.com/subdirectory1/$1 [R=301,L]
or does it get added UNDERNEATH as a separate rewrite rule?
Any help would be appreciated as I am stuck and need to stop these sql errors.
The first thing to try is to add the "NE" flag to the RewruteRule's flags, making it [NE,R=301,L]. This prevents the escaping/encoding of various characters, and may help with this problem ("%25" is a hex-encoded "%" character, and %2525 is a double encoded "%" character).
Otherwise, you may have to detect and 'manually' unencode strings like %252526 to %2526, then %26 and then to "&". This is ugly and inefficient unless you have access to the system "unencode" function via RewriteMap in httpd.conf, and should be avoided if possible.
Jim