All Questions
Tagged with query-string htaccess
15 questions
3
votes
1
answer
5k
views
How to redirect a URL and remove parameters using .htaccess?
I'm trying to redirect a URL ending with parameters to another URL without those parameters.
https://example.com/newsroom/news-events/news.html?L=1&tx_news_pi1%5Bnews%5D=29&tx_news_pi1%...
2
votes
1
answer
226
views
301 Redirect from URL with query string to new URL without query string
I'm having trouble working out how to do a 301 redirect from:
https://www.example.com/catalogue/catalogue.php?catSection=1
to
https://www.example.com/hire-category/access-support-equipment/
I've tried ...
3
votes
1
answer
983
views
301 redirect rewrite query string in .htaccess [duplicate]
I am trying to perform a 301 redirect in .htaccess and I need to remove the query string ?view=full. Here is what I have that is not working:
RewriteRule ^/contact/?view=full$ /contact/ [R=301,L]
I ...
2
votes
1
answer
4k
views
How to form redirect or rewrite where query string contains portion I want to extract to new query string
I've transferred an old custom-made site to Mediawiki and I have many internal and external links to my old pages that I want to redirect to the appropriate wiki page.
There are many links to the ...
2
votes
1
answer
5k
views
Htaccess redirect pages from subfolder to root directory while preserving any query string
I have moved pages in various sub directories to the root directory and want to set up a 301 redirect for each page and keep any query string that might be present. For example:
www.example.com/...
1
vote
0
answers
33
views
Disallow URLs made with mod_rewrite in robots.txts [closed]
Here is my robots.txt file:
User-agent: *
Disallow: /head.php
Disallow: /head/
Disallow: /head
Disallow: /header.php
Disallow: /header/
Disallow: /header
Disallow: /footer.php
Disallow: /footer/
...
3
votes
1
answer
4k
views
How to Redirect Pages with Query String?
I want to Redirect as seen below:
https://example.com/p1/p2?sort=p.model&order=ASC&page=2
to
https://example.com/p3/p4?sort=p.model&order=ASC&page=2
Also, I have this code in my ....
2
votes
1
answer
1k
views
How to redirect all pages of site A, including those with query strings, to homepage of site B
I want to redirect all pages of SiteA to homepage of SiteB.
I used this code in SiteA's .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*)$ https://SiteB.tld/ [...
1
vote
1
answer
3k
views
How to keep question mark in URL rewriting with a GET method?
I am trying to use URL rewriting to rewrite
search-en.php?q=abc
to
pages-afficher-recherche.php?lang_abbreviation=en&q=abc
and I did
RewriteRule ^search-([a-zA-Z]{2})\.php\?q\=([a-zA-Z0-9_-]*)$...
5
votes
3
answers
817
views
Temporarily redirect WordPress url with query string from root directory to new url
This post seems to have my answer:
How can I redirect old WordPress URL (with a query string) to new URL using .htaccess?
However, this does not seem to play nicely with WordPress' previous rewrite ...
2
votes
1
answer
455
views
Redirect query string URL via .htaccess
I am trying to redirect all query strings to a new URL.
Search query example www.example.com/?s=cars to resolve to www.example.com/?search_gcse/?q=cars ("cars" is just an example).
What is the ...
9
votes
2
answers
42k
views
How can I use .htaccess to respond with 403 forbidden status for URLs that contain a query string?
Some bots have been crawling my site for every link that ends with:
?utm_source=dlvr.it&utm_medium=twitter
I haven't checked out its IP.
Then other bots (10+) follow the link rules ?utm_source=...
-1
votes
0
answers
17
views
Hiding and redirecting extensions on my webpage [duplicate]
I want to hide extensions on my webpage using the .htaccess file.
I have managed to do it by using this code;
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]...
2
votes
2
answers
2k
views
Error 404 after rewrite query strings with htaccess
I'm trying to redirect the URLs of a client's website like this:
www.localsite.com/immobile.php?id_immobile=24
In something like this:
www.localsite.com/immobile/24.php
I'm using this rule in ....
3
votes
2
answers
7k
views
How do I redirect a URL using rewrite in .htaccess that has a question mark and forward slash where page.html is the variable?
Hello and thanks to all who contribute to this seemingly mind boggling puzzle. I apologize in advance if .htaccess questions belong on server fault.
So I have to move a domain to our hosting servers, ...