Hey folks, I'm migrating a website over a to new CMS with a different URL structure, I'd like to have users redirect if a specific part of the link is missing. So if the user goes to www.domain.com/articles/name_of_article it'll take them to the old site, however if they go to www.domain.com/ it'll forward them to the subdirectory http://beta.domain.com
So what I'm trying to accomplish is to leave the old URLs active as to not lose traffic from old links since migrating those links is impossible because of how the old CMS was coded..but prompt the user to move over to the new site when they land on those pages.
how can this be accomplished via htaccess, any tips will be greatly appreciated?
Regards and thank you for your help!
RewriteEngine on
RedirectMatch ^/$ http://beta.domain.com/
did it
...The answer was a lot simpler than the question hah
Related
I would like to prevent users from creating wildcard redirects on their websites to mine.
Is this possible? How would I go about doing this?
My site is in PHP. I am willing to add PHP code or edit my htaccess to make this possible.
Thank you for the assistance.
I've tried forcing a page refresh, but the nature of my website would cause an infinite loop to occur.
I have had a website for a couple of years, and this year I decided to update it completely. Most of the content is going to stay but there are some pages that will disappear and I'm adding some new ones. The whole site's design has changed though. When I launch this new site, is it required to create an .htaccess with 301 redirects file? Any help will be much appretiated.
Thanks!
Currently a TYPO3 website of ours has had a complete revamp and we would like to redirect all the old URL's in Googles index to the new existing URL's
For regular pages I used the new site management tool (Redirects) in TYPO3 v9. However what is left is the old indexed links of the content.
www.websitename.com/content/docs/this-is-my-document.pdf and so on. Including images and other miscellaneous links to files.
Now what would be the best way to redirect those links?
I could use htaccess ofcourse or is there something in the TYPO3 core/Extbase what I could be able to use?
I would always prefer redirects with mod_rewrite in the .htaccess file since it's much faster than any TYPO3 solution. If the redirect is done via .htaccess, there is no need for the webserver to invoke PHP or the database. Thus it's faster.
Found out we stopped rewrites by default for URL's with:
RewriteRule ^(typo3/|content/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
By removing the 'content/' I was able to use the redirect functionality from the core. This was done so we could manage redirects through the TYPO3 enviroment in the future.
as Peter said above it would be faster to use .htaccess but we would like for it to be more manageable in the future through the system. So we chose the core option.
I made an update of my non-responsive to responsive template and there is no need of my old fashion static mobile website and redirection to it (www.mysite.com/mobile/index.html). I want to completely remove directory with mobile site so that my old mobile site is not available anymore.
I'm concern with numerous 404 errors afterwords and their effect on my current Google search appearance. Maybe somebody could help me with advice what would be the best practice in this case.
I'm using CSM Joomla, Apache server and I have configured .htaccess file.
I would like the most to 301 redirect whole mobile directory to my home website link (www.mysite.com) but I'm aware that would be really bad from the Google's point of view. Any help would be greatly appreciated.
Redirecting the whole site to the home page would be seen as a soft 404 by Google. Either redirect each page to the new equivalent, or return a 404/410 response.
I searched for a solution of my issue and tried several ways but none of them worked.
I am migrating my website to a new system and want to change the url structure too. But I couldnt find a solution for one of them which is the most important one.
It is an e-commerce site. All product page urls had domain.com/product/productname/ in the previous system and now I need them to go to domain.com/productname.html . So the product part should be catched and redirected to the version without product/ .
Might be very simple too but I couldnt find a solution for that.
Thanks in advance
Cheers
You can use this simple rule in your site root .htaccess:
RedirectMatch 301 ^/product/([^./]+)/?$ /$1.html