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