How can I Rewrite with htaccess file the url
http://www.example.com/index.php?p=1
So it will look like this:
http://www.example.com/index.php
Try adding this :
RewriteEngine On
RewriteRule ^/?index.php$ http://www.example.com/? [L,R=301]
Related
Here is my url:
http://localhost/BA/cookies-policy/register
I want that page to direct to :
http://localhost/BA/register
...and so on if the above link is accessed.
I am not familiar with htaccess.
Try this in .htaccess file in root directory:
RewriteEngine on
RewriteBase /
RewriteRule ^/BA/(.+)$ /$1 [L,QSA]
Basic .htaccess 301 redirect rule for one specific URL:
Redirect 301 /BA/cookies-policy/register http://localhost/BA/register
Rewrite rule to match your needs:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^BA/(.*)$ /$1 [R=301,L]
Try it like below, in your BA directory.
RewriteEngine On
RewriteRule ^cookies-policy/(.+?)$ /BA/$1 [R=301,L]
I have a URL in the following structure like
http://www.naturaflowers.com/100-fresh-cut-wholesale-flowers.html
I want to rewrite the URL like
http://www.naturaflowers.com/fresh-cut-wholesale-flowers.html
We used "ultimate SEO url Plugin" to generate SEO friendly URL. The old URL structure is /index.php?main_page=index&cPath=category_id . My htaccess code is as follows :
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)-(.*).html$ index\.php?main_page=index&cPath=$1&%{QUERY_STRING} [L]
The above mentioned plugin and this htaccess code rewrite
index.php?main_page=index&cPath=100 to
/100-fresh-cut-wholesale-flowers.html . And now I want to
/100-fresh-cut-wholesale-flowers.html rewrite to
/fresh-cut-wholesale-flowers.html everywhere in my website through
htaccess .
Have your rules like this:
RewriteEngine On
RewriteBase /
RewriteRule ^[0-9]+-(.+?\.html)$ /$1 [L,R=302,NC]
RewriteRule ^(.+?)\.html$ index\.php?main_page=index&cPath=$1 [L,QSA,NC]
RewriteRule ^(/?)\d+-(.*)$ $1$2
How to redirect this
https://www.example.com/watch?v=ilTNJoSgeF8
to this
http://www.example.com/#/watch/ilTNJoSgeF8
so it just need to change this /watch?v= into this /#/watch/
Using mod_rewrite, you can do something like this in the htaccess file in your document root:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^v=([^&]+)
RewriteRule ^watch$ /#/watch/%1? [L,NE,R]
i have htaccess problem.
i want use htaccess rewrite mode for change this url:
http://somedomain.com/?id=https://play.google.com/store/apps/details?id=com.supercell.clashofclans
to this:
http://somedomain.com/?id=com.supercell.clashofclans
I've folowed some .htaccess tutorials but I couldn't. How can I make it work?
This should work for you:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^id=(.*)?id=(.*)
RewriteRule ^$ /?id=%2 [L,R=301]
I´d like to do some redirects this for a new Wordpress website:
domain.com/index.php?cPath=24 --> domain.com/about/
My .htaccess (root) looks like:
Redirect 301 /index.php?cPath=24 /about/
I get just this:
domain.com/?cPath=24
You can use mod_rewrite with a redirect flag to accomplish this:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^cPath=24
RewriteRule ^ /about/? [R=301,L]