I don't want to redirect to home page when there is no page or wrong url. I have following in httaccess file

# BEGIN WordPress
RewriteRule ^sitemap.xml sitemap-%{SERVER_NAME}.xml [L]
RewriteRule ^sitemap.xml.gz sitemap-%{SERVER_NAME}.xml.gz [L]
RewriteRule ^index\.php$ - [L]
ErrorDocument 404 /404.php
ErrorDocument 404 /index.php?error=404

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

# END WordPress

I have already 404.php in my theme folder. Let me know what to modify.

  • Do you have this problem with a less modified .htaccess file?
    – s_ha_dum
    Jun 30 '13 at 16:27
  • Yes...I commented the above one, pasted and checked ...still persist.
    – Brij
    Jun 30 '13 at 16:42
  • You are better off renaming your existing .htaccess and letting WordPress generate a new one. Switch themes and disable your plugins. Ordinarily WordPress does not load the home page for 404s if there is a 404.php in the theme. Do you have live URL?
    – s_ha_dum
    Jun 30 '13 at 16:45
  • Thank for reply...I'll check ...live url: techbrij.com
    – Brij
    Jun 30 '13 at 16:49
  • I get http://techbrij.com/cgi-sys/suspendedpage.cgi and can't see anything else.
    – s_ha_dum
    Jun 30 '13 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.