Advice on URL names - Q from SEO course

(Marian Wosnitza) #41

Tried this also. Full URL does not change it.
Still getting: This redirect was not followed.

(Doug Bennett) #42

Did you drop the quotes?
Full URL shouldn’t make any difference. Apache doesn’t care, it will redirect to the complete URL.

If you copy what I posted above it should work. Keep in mind you’re using 301’s which are permanent, meanings they have no expiry so they get cached. If you have an error going to a wrong place they might still go there.

Also are you sure you have the htaccess file in the correct place and with the correct name?

(Marian Wosnitza) #43

I tried it with and without quotes. Both versions did not work in htaccess tester.
My .htaccess file starts with:

RewriteEngine On
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^/(.*)$$1 [R=301,L]

as recommended by my provider. This actually works.
I also tried “RewriteRule ^…$ …” like the syntax above - does not work either.

The .htaccess file is in the root directory on FTP.

(Marian Wosnitza) #44

Since none of the redirects worked so far, I changes 301 to 302 on the FTP - just to be safe.

(Doug Bennett) #45

The one I provided above works great on the tester with your URL’s.
It also works great at redirects to https.
How are you adding to the htaccess file? What editor are you using?
Not sure what exactly is happening but the rules as provided should work unless you have other non disclosued items in your htaccess file.

File needs to be named .htaccess . Usually needs to be in the same directory as your home page.
Redirect’ are processed “top Down” so once a directive is matched it ends, the rest of processing isn’t processed until the request returns.

(Marian Wosnitza) #46

I tried it with just one single line in my htaccess file and put this line in the tester:

Redirect 302 “/solutions/embedded-solutions.html” “/embedded-project-tools/index.html”

It does not work. I get:
“This redirect was not followed.”

(Doug Bennett) #47

The post above I gave you has no quotes.

Drop the quotes

What URL’s are you testing?

I just tested this(with https) :

With the following:

Redirect 302 /solutions/embedded-solutions.html /embedded-project-tools/index.html

And got a good result:

The new url is
Test are stopped, a redirect will be made with status code 302

(Marian Wosnitza) #48

Tested this and it works.
Having a couple of dozens of pages I need to redirect, I assume I have to write the redirect line with full URL, both for source and for target.
Please confirm.
Thanks much.

(Marian Wosnitza) #49

Goodness. Just tired this with full URL - does not work.
How do I write now my many lines of redirects?

(Doug Bennett) #50

Don’t need full URL.

What I gave each time works - I tested it.

Just copy each line and change it. don’t add quotes, or anything.

If have any issues, included a complete version of the htaccess file.

(Marian Wosnitza) #51

If I write
in the request URL line, and below
Redirect 302 /solutions/embedded-solutions.html /embedded-project-tools/index.html
it works fine.

As soon as write more than one line below, like
Redirect 302 /solutions/embedded-solutions.html /embedded-project-tools/index.html
Redirect 302 /solutions-overview/solutions-overview.html /solutions-overview/index.html
Redirect 302 /company/company.html /company/index.html
it does not work. No matter if I enter
in the request URL line.
Putting RewriteEngine On before the redirects does not help either.

(Don H) #52

Are you talking about it not working in the htaccess tester with multiple redirects or on your website?

I went to the tester and the redirects work fine, even with all three added.