Set RewriteBase from PHP

Hi
I’m working to a php software , that use apache mod rewrite.
The problem is that I do not know where the user put it, so I can not set RewriteBase.
I was thinking to edit the .htaccess by php
It’s possible?
Other ideas?
Thank you so much

It is only possible where the .htaccess is not set up correctly so as to prevent such a large security hole.

Thanks for the reply.
Could you explain more?
Wordpress for example how it works?
There is nothing to be set in .htaccess

If you select one of the rewrite options for the post URLs in WordPress then it will update the .htaccess file to add the appropriate rewrite commands but only if the .htaccess has no security applied to prevent programs from updating it. If you install one of the security plugins in WordPress one of the first things it will do is to plug that security hole and prevent programs from being able to update the .htaccess (after writing its own additional security rules to that file).

I don’t see a problem here.

Just create an .htaccess file and put it in your distribution along with other files. It will be right in place wherever a user will put put it.

Excuse me, I realized now that .htaccess behaves differently locally.
If I put in local .htaccess in “localhost/test123” and I set “/” as RewriteBase, was used “localhost/”, but now I tried it on a hosting service and functioning properly.
Excuse me the useless question

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.