Page 1 of 1

.htaccess issue

Posted: Tue Jan 09, 2024 5:49 pm
by doctorized
I am trying to change the url in browser from
to
I ve written the rule:

Code: Select all

RewriteEngine On
RewriteRule ^contact/?$ /index.php?page=contact [L]
and it is not working. What am I doing wrong?

Re: .htaccess issue

Posted: Tue Jan 09, 2024 9:09 pm
by Andesdaf
The rewrite seems to be correct. Maybe a server configuration issue?

Re: .htaccess issue

Posted: Tue Jan 09, 2024 9:12 pm
by normeus
let's say you are using PureBasic to send:

Code: Select all

https://www.url.com/contact
(nothing after contact, if you want "contact/joe" then you have to change the directive)
I assume you are sending "https" then your .htaccess line is fine and should turn it into:

Code: Select all

www.url.com/index.php?page=contact
you can test your htaccess directives here:
https://htaccess.madewithlove.com/

If you are using a browser, and see the wrong address at the address bar, it can also happen that the address bar is being remembered so the address will have the php? url. Delete your address history and it will look the way it is supposed to.

send me a private message if you have any questions.

Norm.

Re: .htaccess issue

Posted: Tue Jan 09, 2024 9:39 pm
by doctorized
normeus wrote: Tue Jan 09, 2024 9:12 pm ......
send me a private message if you have any questions.

Norm.
You have a pm.
Andesdaf wrote: Tue Jan 09, 2024 9:09 pm The rewrite seems to be correct. Maybe a server configuration issue?
redirect 301 rules work like a charm but no RewriteRule seems to work. What configuration could be done in plesk? (Plesk is the only tool that I use to access the my profile including files, settings and so on. I am a user, not admin.)