Advice on URL names - Q from SEO course

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

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?

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 ^/(.*)$ https://www.carnica-technology.com/$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.

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

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.

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.”

The post above I gave you has no quotes.

Drop the quotes

What URL’s are you testing?

I just tested this(with https) :

https://www.carnica-technology.com/solutions/embedded-solutions.html

With the following:

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

And got a good result:

The new url is Find professional Embedded Tools and Solutions | Carnica Technology
Test are stopped, a redirect will be made with status code 302

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.

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

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.

If I write
https://www.carnica-technology.com/solutions/embedded-solutions.html
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
https://www.carnica-technology.com
or
https://www.carnica-technology.com/solutions/embedded-solutions.html
in the request URL line.
Putting RewriteEngine On before the redirects does not help either.

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.

1 Like

See screenshot. The syntax should be correct - according to my provider.

The URL you show in the post is the home page, not the page you want redirected.

Try changing the URL being tested to this:

https://www.carnica-technology.com/solutions/embedded-solutions.html

You’re not getting any syntax error in the tester, but since you have no redirects for the URL it’s simply telling you that each rule wasn’t met.

Hi Doug,
I’m afraid we are running in circles.
I tested what you suggest - see my post from Dec 7th. This works fine.
But if I have several pages from different folders to redirect, what do I put into the URL line?
I can only redirect one page at a time.

When you are testing a specific page redirect (rule), you would put that page’s address in the url line in the tester. This mimics a user going to that page. The testers show what htaccess will do when a user tries to go to a specific page. If the url you put in does not have a redirect, the tester will show that the page will not be redirected. In other words, the user would go to the url as entered.

You need a rule line for each page you want to redirect. In the above test, you have redirects for two pages. If a user tries to go to either of those pages, they will be redirected by the appropriate rule line you have setup and instead of going to the page in the url line, they will go to the destination of the redirect rule.

1 Like

Don (@DLH) nailed it.
The tester can have all your rules (redirects) in the htaccess part.

It will only test one URL at a time.

It works just like a real server in that it processes the directives top down one at a time. It gives the results fo each directive one at a time until it hits one that causes a redirect to occur. It then stops processing, just like a real htaccess file.

Now I understand. I thought the tester will be capable to test my entire file.
Testing one URL at a time works fine.
This was my fundamental misunderstanding.
Thanks for clarifying.
And thanks for your help.

1 Like

No problem,
I would set up a “test script” that has a line with a link to each page you’re redirecting. Just a simple text file.

Put all the redirects in the tester, and one at a time paste each URL in and test it. Once you’re satisfied with the results, put the htaccess file into the server and. test live with each URL. If you setup the test script correctly it’s just as simple as clicking each entry and ensuring it redirects to the expected page.

By settings up a simple test script you can reuse and add to it as needed in the future. This gives you a good tool to regression test future changes.

1 Like

I tested every redirect line by line. All worked fine in the tester.
The same lines in .htaccess had not only no effect, they caused a blank screen when the old URL was called.
I am in dialogue with the provider IONOS to find out what went wrong.
Will let you know when I make progress.