I have a site with URL's like this:
http://website.com/browse/wedding-service-providers/bridal-wear-and-accessories/
I'd like to remove
/browse/wedding-service-providers
from the url each time so that the resulting URL is
http://website.com/bridal-wear-and-accessories/
Thanks for your help :)
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)-c-(.*)$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
Then url like
http://website.com/bridal-wear-and-accessories-c-3/
in this url 3 is the id of category
Related
Hi my site url is like
https://example.com/articleDesc.php?post=paleo-diet-what-is-it-and-why-is-it-so-popular
I want to modify this url as
https://example.com/paleo-diet-what-is-it-and-why-is-it-so-popular
But i want to use this query string value to get the respnse
Thanks in advance
Just use:
RewriteEngine On
RewriteRule ^([^/]*)$ /articleDesc.php?post=$1 [L]
I have a URL like www.test.com?id=other-flavor&pid=hannycakes.
I did above URL like www.test.com/other-flavor$pid=hannycakes using .Htaccess
but I need www.test.com/other-flavor/hannycakes.
For this If I use / in my URL it can take as a folder.
How resolve my problem. How to put / in URL?
Try this:
RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)$ /?id=$1&pid=$2 [L]
I have various broken links of the form:
http://www.mysite.com/categA/categB/product*.html
(the final part of the url starts with the string "product")
and I want to create an .htaccess rule to redirect them to:
http://www.mysite.com/categC/categD/product*.html
...
Any ideas? Thanks in advance!
I believe this will work.
RewriteEngine On
RewriteBase /
RewriteRule ^categA/categB/product(.+)\.html$ categC/categD/product$1.html [L,R=301]
I want to rewrite a URL through htaccess, but I am not getting the solution to do the specific rewriting. For e.g., I have a URL:
http://www.yourdomain.com/page/about-us.html
Now I want to remove page from above URL, so it should look like;
http://www.yourdomain.com/about-us.html
Can anybody help me with this.
Thanks in advance.
Something like this should work:
RewriteEngine on
RewriteRule ^about-us.html$ /page/about-us.html
If you need it done on any URL put into the site, then something like this:
RewriteEngine on
RewriteRule ^([_\&\'\,\+A-Za-z0-9-]+).html$ /page/$1.html
Assuming you want a 301:
RewriteEngine on
RewriteRule ^page/about-us.html$ /about.html [R=301,L]
I need help to redirect the following URL (in htaccess)
http:www.domain.com/article/the-bp-oil-spill-one-year-later/19918396/20110420/
To
http:www.domain.com/article/the-bp-oil-spill-one-year-later/19918396/2011/04/20/
my original rewrite is:
RewriteRule ^article/([^/]+)/([0-999999999]+)/([0-99999999]+)/?$ /index.php?a=show-post&slug=$1&articleid=$2&date=$3 [QSA,L]
and I am trying to do away with this to a pattern which is like:
domain/2011/04/20/article-name-here/
Appreciate your help on this.
Thanks,
L
Are you after something like this:
URL Example: blah/20080101/
RewriteRule ^blah/([0-9]{0,4})([0-9]{0,2})([0-9]{0,2})/$ /blah/$1/$2/$3/
Would output:
/blah/2008/01/01/
Current/Old: /article/the-bp-oil-spill-one-year-later/19918396/20110420/
RewriteRule ^article/([^/]+)/([0-999999999]+)/([0-99999999]+)/?$ /index.php?a=show-post&slug=$1&articleid=$2&date=$3 [QSA,L]
Desired/New: 2011/04/20/article-name-here/
RewriteRule ^article/([^/]+)/([^/]+)/([0-9]{0,4})([0-9]{0,2})([0-9]{0,2})/?$ /$3/$4/$5/$1 [R=301,QSA,L]
This will allow existing links to your current/old style urls to be redirected (permanently) to your new style urls. This assumes that your php app doesn't need to also have the articleid passed to it - note that articleid is not in your new/desired URL.