I made a redirection with the following code in my htaccess file.
<IfModule mod_rewrite.c>
RewriteRule ^videos(/.*)?$ https://www.wemagicmusic.com/clips-wm/ [L,R=301,NC]
</IfModule>
It worked when I did it. But now, strangely enough, it doesn't work anymore. I don't understand what's not working.
Can you help me, please?
Thank you in advance.
Related
I have wasted a lot time fixing this issue, now i am turning to get help from experts.:
Issue:
My URLs are dynamically working such as :
https://www.example.com/services?s=10
and I want to rewrite, to serve it as following:
https://www.example.com/services/advanced-biotec-facials
I have tried following code in htaccess:
Options +FollowSymLinks
RewriteEngine on
RewriteRule services-advanced-biotec-facials$ services?s=10
but the urls is becoming:
https://www.example.com/services-advanced-biotec-facials
I have also tried following code in htaccess:
Options +FollowSymLinks
RewriteEngine on
RewriteRule services/advanced-biotec-facials$ services?s=10
the code is not working with /services/
i have copied my htaccess in following txt file for share:
https://www.nrbeauty-dubai.com/share.txt
Please help as I have wasted my time a lot already.
also, I need the old dynamic URL to be redirected to the new rewrite URL.
Thanks in advance.
have u tried swapping them
RewriteRule ^services?s=10$ http://www.example.com/services/advanced-biotec-facials/ [R=301,L]
I've been banging my head for the past couple hours, searching through past questions and trying to figure out how to do this.
I have the following .htaccess file:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
This works great - all of my .php files now have no extension.
So, example.com/news.php => example.com/news
Now, I tried setting up 301 redirects in numerous ways, but none of them seem to work. What I'd like to get is the following:
example.com/about/ => example.com/about/our-story
example.com/work/ => example.com/
I've tried the following code:
Redirect 301 /about/ /about/our-story
And I even tried this, but no luck:
RewriteRule ^/work/$ http://example.com/ [R=301,L]
But I'm sure that because of the rewrite, it's just not working. I guess I just can't wrap my head around this. I've been troubleshooting this site all weekend and my brain is fried. I'm sure the answer is right in front of me, but if someone could help guide me in the right direction, I would really appreciate it.
Thanks in advance!
Don't use ^/ in htaccess.
Try this rule
RewriteRule ^work/?$ http://example.com/ [R=301,L]
I just learnt about url-rewrite for my website with .htacess. My actual url is:
localhost/index.php?view=some-page
So i write this RewriteRule like this:
RewriteRule ^/([^/]*)/?$ /index.php?view=$1 [NC,L]
When i typed localhost/homepage on my browser, It does not work, it displays error 404 object not found. What have i done wrong please show me.
Many thanks
This should work in your DocumentRoot/.htaccess:
RewriteEngine On
RewriteBase /
RewriteRule ^([^/]+)/?$ index.php?view=$1 [QSA,L]
Leading slash is not matched in htaccess.
are you using apache?
This link from step 6 helped me
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-14-04
When i was playing around with rewrites i had to enable it and tell apache where the pages were stored
I am completely nube with htaccess rewriting. Today I am stuck with a problem..
I want my url www.try.com/formal-shoes.php?catId=2 to show as www.try.com/second
second one www.try.com/formal-shoes.php?catId=1 to show as www.try.com/first Like this. Please help me to do so. what shall be rule...
As by hit and trial I wrote
<IfModule mod_rewrite.c>
RewriteRule formal-shoes.php?catId=2 second/$1 [R=301,L]
</IfModule>
You are looking at this the wrong way! Your rewrite rule should be like:
RewriteEngine on
RewriteRule ^/second$ index.php?catId=2 [QSA,L]
RewriteRule ^/first$ index.php?catId=1 [QSA,L]
Note: We are rewriting the expected url to the actual url. Also, RewriteEngine on is mandatory!
PS. Its Noob not nube :)
As said in the Title,I want that http://www.example.com/contact should show http://www.example.com/contact.php. And important: without redirecting.
Unfortunately my .htaccess Code does not work:
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^contact$ contact.php [L]
What could be the reason for this? Please help me out how to fix it :(!
EDIT: SOLVED. Google helped me out.
Adding Options -Multiviews was the Solution. Thanks everyone!
I do believe you have to put the / at the beginning of contact because it's part of the path.
Try this:
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^/contact$ contact.php [L]
The only way to make the URL at the top show .php when going to the URL without PHP would be to redirect the browser to it. The easiest way to do that in most apache instances would be:
Redirect permanent /contact http://example.com/contact.php