htaccess redirect on url with a particular character inside - .htaccess

I have a website with a lot of wrong urls that Google can't indexize and i need to redirect them to the right url in .htaccess
This is the wrong url:
https://example.com/product/right-title/#ALOT-of_crap_9788839550972-queue
and i need to redirect to
https://example.com/product/right-title/
I have no idea how to do it, could somebody help?

Related

Redirect Whole website to new domain with .htaccess file

Can Anyone help me to find the solution how to redirect my whole old url to new url.
For example
My old ulr is:
www.example.com.au/blog
I want to redirect this domain to new domain like that
www.newdomain.com.au/blog
Try
Redirect 301 / www.newdomain.com.au/blog
More infos here

Need help redirecting one website URL to another with apache2 and .htaccess

I have two domains - https://hosting.opensimcity.org, and http://paradigm.pocketmud.com and I want to redirect the latter to the former. That is, when someone connects to http://paradigm.pocketmud.com I want it to redirect to https://hosting.opensimcity.org/paradigm
Any tips on doing this in my .htaccess file?
Just try the following htaccess redirect code:
Redirect 301 / https://hosting.opensimcity.org/paradigm
This 301 redirect response notifies the search engines that the page has moved permanently from the old URL to the new URL. The search engines also transfer the old URL page rank to the new URL.

Using htaccess to redirect URL from one query string to another

I need to redirect
from
/showthread.php?tid=6
to
/viewtopic.php?t=6
using htaccess. We moved from MyBB to PhpBB and would like to safe links leading to our site.
The domain remains the same. All my attempts failed.
Can someone help?
^showthread.php?tid=(\d+)$ viewtopic.php?t=$1
This should do the trick with htaccess redirect parameter :)

htaccess URL redirect based on page title

I would like to add a line to my htaccess to change this url:
RewriteEngine on
do this is the url
http://site/Calendar/viewevent?eventid=9223
into something like this :
http://site/Calendar/viewevent/Title-of-event
its php and joomla and I am a php developer, please dont advise me to use a component or module to handle redirects, I am trying to achieve this using .htaccess ONLY :) thank you in advance!!
Your 'pretty' url contains information that is not in the 'working' url. Besides that, the 'working' url also contains information that is not in the pretty url. You need database access to translate the event id to a seo-title, and the seo-title back to an event id. In other words: It is impossible to do this with .htaccess only, unless you change 'viewevent' to accept an event by seo-title, instead of eventid.
Mod_dbd can possible be used, but only in the server config file, not .htaccess.
As Sumurai8 says htaccess cant transform url like you want automatically.
But you can use Redirect 301 (or its variation) for one url to another.
for your example:
Redirect 301 /Calendar/viewevent?eventid=9223 /Calendar/viewevent/Title-of-event
more information here

Can't figure it out: Redirection showing old url

I'm using cpanel and tried using htaccess and it's not working.. I need to redirect prismafoto.com.ar to brujaurbana.com.ar/prisma but when it does the url that is shown is brujaurbana.com.ar/prisma
How can I do this?? thanksss :(
Sounds like you are wanting to do a masked URL redirect. Meaning, you want the domain to redirect but stay the same in the URL bar.
http://webstarthelp.com/forwards.html
The above site has a great Masked URL Redirect.
Simply create a index.html file on prismafoto.com.ar and paste the generated code.
Make sure to clear the .htaccess file so redirects do not conflict.

Resources