-1

I was playing around with the .htaccess file on my site, and though the homepage works. All links are broken, showing 404 error. I also cannot click on anything but the homepage.

If it matters here is the .htaccess

RewriteOptions inherit
# BEGIN LSCACHE
# END LSCACHE
# BEGIN NON_LSCACHE
# END NON_LSCACHE

#User added redirects
redirect 301 ^/channelactivist\.com/?(.*) http://channelactivist.com/$1 
redirect 301 people-of-earth-unrenewed-at-tbs/      http://channelactivist.com/people-of-earth-unrenewed-at-tbs/ (#500+ of these)

# 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
  • I know you know this now and sorry to be pedantic, but just make sure you make a backup copy of any file before editing. I forgot this sooooo many times. – Martin Dimmock Jun 30 '18 at 20:17
1

You have syntax errors in the 2 redirects you have listed.

"Redirect" does not allow ^ or \ or ?(.*). You need to use "RedirectMatch":

RedirectMatch 301 ^/channelactivist\.com/?(.*) http://channelactivist.com/$1

For the other lines, you need an opening / or it won't match those URLs. It's also more common to use a space instead of a tab. However, this redirect actually doesn't redirect at all - you're pointing the same URL at itself (unless this .htaccess is on a site other than channelactivist.com), so hopefully your actual redirects are a little different than what you posted:

Redirect 301 /people-of-earth-unrenewed-at-tbs/ http://channelactivist.com/people-of-earth-unrenewed-at-tbs/

You can verify these are the problem by removing your redirects and adding one at a time, then testing and tweaking to make sure it works, before adding the others.

  • Thank you. I managed to fix the 404 errors on the links within the site. Turns out the .htaccess page was corrupt. I'm going to work on adding that / to the other links on the site. – jjf3 Jun 29 '18 at 16:10

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.