Changing routes does not update .htaccess

Hi,
I think I’m hitting a bug here. I made changes using the Wappler routes menu but those changes did not propagate to the .htaccess file. Effectively, I see the old configuration. Maybe I’m doing something wrong, but this is what I did:

WHAT I DID

  1. Click on the Routes menu in the left pane
  2. Delete a route that is no longer in use
  3. Change a URL of an existing route to a new value

WHAT I OBSERVED
A) the .htaccess file still has the route that I deleted
B) the route that I changed still has the old values.
C) there seems to be that every record appears twice.

BTW, Wappler duly messaged me saying that the new routes had been generated. I also tried clicking on the Generate Routing Rules button with the same results.

WHAT I EXPECTED
The routes changed to the values I entered and the deleted records to disappear.
Only one instance of each record.

Many thanks,

Are you checking the local htaccess file in your project folder?

Yes I am.
And I see that the file is ftp’ed to the server.

And I forgot to add that I’m using
Wappler 4.6.2
Windows 10
PHP server model

So is it only the old paths not being removed? If you create a new rule, do you see it added?

Hi Theodor,
There are at least 3 problems:
a) The old routes are not being removed from .htaccess
b) the changes are not reflected on .htaccess
c) everything in .htaccess seems to be duplicated

To what I should add, based on your question:
d) I don’t seem to be able to add a new route.

Hope this helps,

Alex

What do you mean?

I click on the add route button and nothing happens

Alex Schoijett
+1 647-924-7253

Bumping on this unresolved topic.
Wappler 4.7.0
Windows 10
PHP server model

I created two server connect routes (LoginGoogle) but these last two do not appear in the htaccess file.

Please advise.

Have you clicked the generate button in the routes panel?
And have you tried closing and reloading the htaccess file after that?

Yes to all, uploaded and generated the routing rules multiple times and had a look at the htaccess on both local and server.
image

FYI, Wappler does try to write in the file and saves it (see today’s date and time: right now), but nothing new in it:
image

Can’t really recreate this locally. Here’s an example of a PHP project using htaccess and it’s working just fine:

Just did this now:

Does it make any difference if you backup the contents of your .htaccess file somewhere and then delete it from the .htaccess file, save it and try to add the rules to an empty .htaccess

Also, do you see the rules added in this file:


(make sure to enable show hidden files first in file manager)

I’ll rework the htaccess file, might be corrupted somehow, and will advise.

All good here:
image

Ok then backup the contents of your htaccess and test with an empty one to see if it works.

1 Like

I have seen this issue in a couple of projects.
I have no idea why/how it happenned. Interestingly, even cloning the project again from Git results in same behaviour.
Never reported it since apart from those couple of projects, it does not happen in any of the other projects. And there is no way to reproduce it.

Indeed new htaccess file generated and updated upon new route creation.
Old file was corrupt somehow...? Yet we see nothing wrong in it.

Might it be that Wappler stops updating it once we make manual changes to it?

No, wappler just updates the section with its routes rules.
Maybe something specific in your htaccess breaks it though, maybe you can try adding your custom rules section by section to see which one is causing this.