How i can proceed for rewrite this url
http://mywebsite.local/videos?c=mycat
to
http://mywebsite.local/videos-mycat
Thx
RewriteRule ^videos-mycat/?$ videos?c=mycat [NC,L]
maybe...
This is what you're looking for
RewriteEngine On
RewriteRule ^videos-([^/]*)$ /videos?c=$1 [L]
Related
Could anyone advise on how to I can rewrite this url:
https://test.com/user/user.php?u=name
to
https://test.com/user/user/name
Please?
Below is my rewrite rule but it's not doing exactly what I want.
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)/user/([^/]+) /user.php?u=$1 [L]
Thanks a lot
Try this:
RewriteEngine On
RewriteRule ^user/user/([^/]*)/?$ /user/user.php?u=$1 [L]
I want to redirect all requests to http://www.example.com/category/* to http://www.example.com.
This is what I tried:
RewriteRule http://www.example.com/category/.* http://www.example.com [R=301,L]
Unfortunately, this does not work. Any ideas how to write the rule correctly?
Thanks!
You can use:
RewriteEngine on
RewriteRule ^category/ /? [NC,R=301,L]
Please try below thing.
RewriteEngine on
RewriteRule "http://www.example.com/category/.*" "http://www.example.com" [PT]
My url looks like
http://example.com/picture.php/82-1/category/19-appenzell_ausserrhoden?map
I want this to be re-written as
http://example.com/picture/82-1/category/19-appenzell_ausserrhoden?map
How can I do it in HTaccess?
I think this will work:
RewriteRule ^picture/?$ picture.php [NC,L] #flags: case insensitive, last
You can use this rule:
Options -MultiViews
RewriteEngine On
RewriteRule ^picture/(.+)$ picture.php/$1 [NC,L]
I have the following URL structures for my website:
http://domain.com/slug/1/test-test.html
http://domain.com/slug/2/test-test.html
and i want to change it to
http://domain.com/new-1-test-test.html
http://domain.com/new-2-test-test.html
i have already tried
RewriteRule ^slug$ /new- [R=301,L]
RewriteRule ^/?my\slug /new [R=301,L]
but it does't work..
anyone know how to redirect this with htaccess?
Thanks
Try this - RewriteRule ^slug/([0-9]+)/(.*)$ /new-$1-$2 [R=301, L]
RewriteEngine On
RewriteRule ^slug/([0-9])/(.*)$ /new-$1-$2 [R-301,L]
How to rewrite the url in htaccess
www.mywebsite.com/category.php?name="richard" change to www.mywebsite.com/richard/
You can use below code to achieve your requirement.
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{QUERY_STRING} name=(.*)
RewriteRule category\.php$ /%1/
Hope this helps you... :)
Are you used any PHP frameworks(like the codenigter... etc)?
You can try this:
RewriteRule ^(.*)$ /category.php/name=$1 [L]