So I have the url: myurl.com/projects/url/visit.php?link=fbehe and I want to rewrite it as so:
myurl.com/u/fbehe
But it isn't working. I am using this so far:
RewriteEngine On
RewriteRule ^/u/([^/]*)$ visit.php?link=$1 [L]
I would also like to note that I placed my htaccess file in the directory with my visit.php file. so myurl.com/projects/url/.htaccess
How could I achieve this?
Try using NC as well. Also, not sure if the absolute path is working. Try a relative if the .htaccess is in the root of your website.
do you use any framework of this? maybe u can you there functionality like routes. can rewrite your url..
Like Codeigniter,Cake
They have routes to change the url like that.
You may try this:
Maps silently
http://myurl.com/u/anyvalue
with or without trailing slashTo
http://myurl.com/projects/url/visit.php?link=anyvalue