Forum Moderators: phranque

Message Too Old, No Replies

How to 404 all urls from sub directory?

         

philgames

1:09 pm on Jun 10, 2014 (gmt 0)

10+ Year Member



Hello,

I have wordpress on my site and some moron (before I owned the doamin) hacked the previous owners and put the rubbish usual hacked links on the domain and spammed them... the domains really great if it wasnt for that. anyway I have wordpress installed on the site and these hacked pages used to be on urls in /?/ like so.. I cannot ignore this problem because on these urls wordpress is stupidly showing homepage content and not a 404 because of this ? my question is how do I block 404 or hopefully totally gone error these pages

here is what I mean

http://www.example.com/?/2013/12/post1891/payday-loans-quid

I tried just uplaoding a wordpress site to /? but godaddy installatron didnt let me... can some one help!

Oh yes

something to not is that I cannot access my godaddy ftp properly... godaddy just shows me ftpquota and that is it. If i try and upload a htaccess on the root I just break the entire site totally with 500 internal errors and I have been messing around for hours just trying to get my wordpress site back up... in the end I had to reset the whole hosting account because deleting everything didnt help. So this means that I can only upload to the /?/ folder...... thanks godaddy.

Any help would be really appreciated.

thank you guys.

ps, I created a empty foler called ? in root and added .htacces file containg

http://www.example.com/?/2013/12/post1891/payday-loans-quid ErrorDocument 404 but wordpress still showing homepage content there.

philgames

2:49 pm on Jun 10, 2014 (gmt 0)

10+ Year Member



I have now got access to the htaccess through ftp.. SO i want /?/ and all the urls in /?/ go to 404?

lucy24

5:39 pm on Jun 10, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



on these urls wordpress is stupidly showing homepage content

This "stupidity" is an inherent property of every CMS. Somewhere in your primary htaccess is a RewriteRule that says-- in English-- "if the request is for any file that doesn't physically exist, serve the front page instead". That's simply how wordpress-- and Joomla, and Drupal, et cetera-- works.

To bypass this behavior, you need to put a redirect in the same htaccess, before this global rewrite.

http://www.example.com/?/2013/12/post1891/payday-loans-quid ErrorDocument 404

This form is entirely wrong; I'm surprised it doesn't just create a 503 error on all requests.

You need to find out whether that /?/ is interpreted as part of the path, or whether everything after the ? is read as a query string. If it's considered part of the path, the pattern involves
/\?/
If it's considered query string, the pattern involves
%{QUERY_STRING} ^/

Can we assume that the sequence /?/ never occurs in any real URL on your site?

philgames

5:51 pm on Jun 10, 2014 (gmt 0)

10+ Year Member



thank you for your reply really appreciate it.


if I go to

http://www.example.com/pizza/2013/12/post1891/payday-loans-quid

instead of using ? I get a 404 error... so its the ? that is doing something.

If I get rid of /?/ and use

http://www.example.com/2013/12/post1891/payday-loans-quid

it goes to a 404..

Is there some way to redirect/rewrite the htaccess and get rid of the /?/ somehow... currently in my htaccess is just the standard htaccess for wordpress which is:


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress


Sorry if I am a bit slow am im not great at programming.