Does anyone know a working way for this to be done?
Rewrite url http://example.com/index.php?page=the-page to http://example.com/the-page
I hope that someone know how this is done, can't find a working rewriterule.
Thanks.
Found it here..
So if anyone need this too :)
RewriteEngine On
RewriteRule ^([A-Za-z0-9-]+)/?$ index.php?page=$1
Related
What is the problem with my .htaccess
This Works:
RewriteRule ^ressource\.n\.1/ /lesson [L,R=permanent]
But this, don't work. I don't know why.
RewriteRule ^index.php?id=51$ /file/?id=51 [L,R=permanent]
I just want when a visitor hit https://www.example.com/index.php?id=51 is going to https://www.example.com/file/?id=51
Thank you!
I would like to add friendly URL's to my website. But I have one problem. I've never used .htaccess.
My link:
https://example.com/index.php?page=users
I would like to have an URL like this:
https://example.com/page/users
OR
https://example.com/users
Is there anyone who can help me?
Problem is solved with:
.htaccess:
RewriteEngine On
RewriteRule ^([^/\.]+)/?$ index.php?page=$1
So it is very simple.
I hope someone can help me, I am looking to help an ex-client with some troubles.
they have images from URL's with this sub-sub structure:
http://images.abc1234.SPECIFIC-DOMAIN.com/image.jpg
Due to a long story I do not completely understand, that sub sub structure exists and now is in peril.
Can anyone point to a solution to rewrite the above into:
http://images.ANOTHER-DOMAIN.com/image.jpg
which would also NOT AFFECT something like this:
images.THIRD-DOMAIN.com/image.jpg
Any help to this challenge would be appreciated.
Thank you and sorry if this is written in bad form, it's not my area of expertise.
this will redirect:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^images.abc1234.SPECIFIC-DOMAIN.com$ [NC]
RewriteRule ^(.*\.(jpg|png|gif))$ http://images.ANOTHER-DOMAIN.com/$1 [L,R=301]
I know this question is very basic but if someone could help me here, I would be very grateful.
I am trying to redirect all requests to http://example.com/index.php?/api/function to http://anotherexample.com/api/function using htaccess
I have been doing some research and all I find are redirect with the POST method but nothing really explained with GET.
I have tried:
RewriteBase /
RewriteRule ^index.php?/api/function http://anotherexample.com/api/function [NC,L,R=301]
this gives me no success.
Thanks in advance
I got it working with the code above:
RewriteCond %{QUERY_STRING} ^/api/(.*)$
RewriteRule ^index.php http://anotherexample.com/api/%1? [QSA,L]
thanks for the tip CBroe
I'm starting to learn mod_rewrite and experiencing a problem that I can't solve myself.
I have an url: http://abc.domain.com/en/page.php?id=1
which I want to rewrite to http://abc.domain.com/en/1 when a customer visits it.
I've tried something like this
RewriteRule ^([0-9]*)/$ /vacancies.php?id=$1
but it doesn't really work. I believe the problem is with path as my site located on subdomain(abc) and in folder(en)
I would really appreciate pointing me to the right direction.
Use this in your abc.domain.com/en/.htaccess
RewriteEngine On
RewriteBase /en/
RewriteRule ^([0-9]+)/?$ vacancies.php?id=$1 [NC,L,QSA]