Jump to content
jamestl2

Having 301 Redirect Problems

Recommended Posts

I’m trying to move a few of my pages into new categories and redirecting the old ones via cpanel. I entered this into the redirect setup and received this error (I'm using wordpress):

 

>  Apache detected an error in the Rewrite config.
 
 Syntax error on line 14 of /home/public_html/.htaccess.E86RC8slwVDheTlEypzC8LrMW3XvwPQ9:
 RewriteBase: only valid in per-directory config files

 

Then I tried just entering one of my redirects this way into my .htaccess file manually:

 

>  RewriteRule . /index.php [L]
 </IfModule>
 
 # END WordPress
 
 
Redirect 301 www.toptenlisted.com/science/top-10-ideal-future-inventions-and-technologies
www.toptenlisted.com/computers-technology/top-10-ideal-future-inventions-and-technologies

 

But with this I get a 500 internal server error and my whole site shuts down. I also tried adding the "http://" part too, but no luck. I don’t know what else to try.

 

(In that example I’m trying to redirect my page “Top 10 Ideal Future Inventions and Technologies” from my science category to my computer-technology category)

Share this post


Link to post
Share on other sites

It sounds like you either have the syntax wrong somewhere in your .htaccess. If you open a ticket and tell us exactly what you want to achieve, we'll take a quick look for you ( or you can post here, with your complete .htaccess file )

 

If you post it here on the forum, remember to remove any sensitive info ( usernames etc).

Share this post


Link to post
Share on other sites

From the looks of it the statement is not complete. Where is the page information? Like ending each with /*.php

Share this post


Link to post
Share on other sites

Ok, now I don't know what's going on, when I open my cpanel file manager, my htacess file doesn't even show up, but when I open my FTP program (Filezilla), there it is, but I can't access it.

 

But even when it was showing up (in cpanel) it still wasn't working, I suppose I'll just have to open a ticket then

Share this post


Link to post
Share on other sites

The .htaccess file is a hidden text file. That's why it would appear in one program and not another if the program was not configured to show hidden files.

Share this post


Link to post
Share on other sites

Then why does it show up sometimes, but not other times (in the cpanel file manager)? Does it have something to do with permissions? code? Or what?

 

(I need to see the file for when I open up a ticket)

Share this post


Link to post
Share on other sites

There is a setting in cPanel's File Manager that you have to check to see hidden files. Files beginning with a period in *nix are hidden to non-superuser users.

Share this post


Link to post
Share on other sites

Where exactly is this setting? I don't see a checkbox or anything to mark anywhere.

Edited by jamestl2

Share this post


Link to post
Share on other sites

At the screen "File Manager Directory Selection", there is a checkbox for it. When you see this screen for the first time there is an option saying "Skip this question, and always open this directory in the future when opening File Manager". If you have checked that option am not sure if you can get this screen back to check the box for hidden files.

Share this post


Link to post
Share on other sites

Alright, thanks Thomas

 

Here is my .htaccess code (In case anyone can spot a simple error I'm missing somewhere within it):

 

>Options +FollowSymLinks 
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^toptenlisted\.com 
RewriteRule ^(.*)$ http://www.toptenlisted.com/$1 [R=permanent,L]
# index.php to /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L] 
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress






Redirect permanent http://www.toptenlisted.com/About%20Site.html http://toptenlisted.com/ten-things-about-toptenlisted



RedirectMatch permanent ^/Index.html$ http://www.toptenlisted.com

Share this post


Link to post
Share on other sites

Don't include the domain name in the first part of the redirect. The 2nd part should begin with http://domain/. So, using the example from your original post, it should be:

 

>Redirect 301 /science/top-10-ideal-future-inventions-and-technologies
http://www.toptenlisted.com/computers-technology/top-10-ideal-future-inventions-and-technologies

Edited by click

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...