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]
Related
I currently goto:
support-requests/?st_id=7
Ideally i would like to just go straight here using .htaccess url-rewriting to make the page neater to look at and navigate to without the "?st_id=" being displayed in the url.
support-requests/7
This is what i currently have but i know its wrong and it does not work:
RewriteCond %{QUERY_STRING} ^(\w+)=(\w+)$
RewriteRule support-requests/ support-requests/%1/%2/?
Could i have some assistance in getting this correct please?
Thanks
Use this:
RewriteEngine On
RewriteRule ^support-requests/([^/]*)$ /support-requests/?st_id=$1 [L]
Should leave you with:
www.example.com/support-requests/7
I have the following url:
http://example.com/folder/index.php?module=centrale&DIO0=1
I need this page to be availeble with the following URL format:
http://example.com/folder/centrale/?DIO0=1
But how do i rewrite this using htaccess properly? What i've got so far:
RewriteEngine On
RewriteRule ^centrale/(.*)$ /index.php?module=centrale ????? $1
Notice that the DIO0 parameter is not always the only one, so the query string must be completly passed trough. Thanks in advance for helping me out or setting me in the right direction.
Edit: the htaccess file is located here: http://example.com/folder/
Try this :
RewriteEngine on
RewriteBase /folder/
RewriteRule ^centrale/$ index.php?module=centrale [L,QSA]
the [QSA] flag (Query String Append) will add the rest of the parameters automatically
I need help with dynamic search pages. I need to change:
/download.php?q=search
to
/download.php?mp3=search
So only search pages need to change q to mp3.
I would appreciate if someone could help. I want to do this through .htaccess
Thanks in advance
The query string is only available as a variable with RewriteCond. Something like this should work:
RewriteCond %{QUERY_STRING} q=([^&]*)
RewriteRule ^download.php download.php?mp3=%1 [L,QSA,NC]
something like that:
RewriteRule ^/download.php?q=(.*) /download.php?mp3=$1 [L]
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 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