FAQ Database Discussion Community


301 Redirect entire site to new site using .htaccess file

.htaccess,mod-rewrite,redirect,http-status-code-301,http-redirect
Ive got a site siteONE.co.uk that i want to 301 permanent redirect all the pages to another site, siteTWO.co.uk For this im currently using the this .htaccess file below, but im have to type out a new line for each page i want to rediect even though they are all...

redirect one domain to the other while removing a subdirectory from the uri

.htaccess,mod-rewrite,http-status-code-301
I am trying to redirect a third level domain (sub.domain1.com) but only if it matches a subdirectory: http://sub.domain.com/somefolder This will then be redirected to another domain (domain2.com) but needs to remove the /somefolder part so say this: http://sub.domain.com/somefolder/about Will read like this upon redirect: http://domain.com/about This is what I have...

Htaccess Code not working after changing Server

php,regex,.htaccess,mod-rewrite,http-status-code-301
I was using this code in htaccess to strip any directory to index.php RewriteRule ^.(index.+?\.php)$ /$1 [L,NC,R=301] For instance http://www.example.com/toys/index.php http://www.example.com/battery/upload/index.php http://www.example.com/xyz/photos/index.php It was changing redirecting all of them to http://www.example.com/index.php Now when i changed my server - this code is causing 404 pages Is there any alternate modification which...

How to redirect urls after deep level folder name change using rewrite rule

regex,apache,http-status-code-301,url-redirection
Our site spans across multiple languages (16 total), so the beginning of the url can contain 16 different subfolders. We have a subfolder beyond the lang/locale folder that has changed names so I am wondering how to redirect to the urls that involve the new subfolder name while also redirecting...

how to redirect link 404 error with content symbol url

php,.htaccess,mod-rewrite,redirect,http-status-code-301
I couldn't find a straight answer to my question and need to know it from the real experts. I have a link 1) http://www.example.com/example.html%20text-decoration:%20none%E2%80%9D%3Eexample.com%3C%20%3C/i%3E%3C/span%3E%3Cbr%3E%3Cbr%3E%3Cbr%3E%3Ctable%20bgcolor= 2) http://www.example.com/examindex/?p=2343543 My question, how can I redirect link 301 with a .htaccess file? i want to redirect 301 link 1 to http://www.example.com/example.html redirect 301...

Is there a 301 wildcard match?

.htaccess,redirect,http-status-code-404,http-status-code-301
I am having great difficulty fielding all the 301 redirects that seem to be needed following a complete site redesign. Entire sub-directories and their extensive content no longer exist. If, for example, 'myolddata' was a folder that no longer exists, and was full of countless files that each no longer...

Generating Http 301 Response Message

java,webserver,http-status-code-301
I'm trying to create a little web server and have be able to generate Http response messages 200, 301, and 404. I am able to get 200 and 404 to work, but I am having problems with 301. When I try to access a page that has "permanently moved" my...

Importing to WordPress without losing page ranking and permalinks

xml,wordpress,.htaccess,redirect,http-status-code-301
I have imported all of my blog posts from a different CMS to a local WordPress setup to test things out before going live. Here is the layout of the XML file containing posts from the old CMS: <PublishingArticles> <ID></ID> <CategoryID></CategoryID> <AllowComments></AllowComments> <AllowPingback></AllowPingback> <Body></Body> <Categories></Categories> <ContentFormat></ContentFormat> <IsAppoved></IsAppoved> <IsPrivate></IsPrivate>...

Issue with simple 301 redirect

.htaccess,http-status-code-301
In my .htaccess file I have the following redirect: Redirect 301 /concrete5-themes/street/ http://www.c5themes.co.uk/street-theme-for-concrete5/ However, this sends you to http://www.c5themes.co.ukstreet which is obviously wrong. What's wrong? Thanks Dave...

Cancelled SSL, Google still takes user to HTTPS

wordpress,apache,.htaccess,http-status-code-301
My problem is on a GoDaddy hosted Wordpress installation. I decided to move the site just a few days after adding SSL, and I left the certificate behind, I no longer want it. Many users are still seeing my site as https://example.com because Google indexed this, or because the site...

Will using redirects to combine content from several pages into one pages affect search engine ranking?

redirect,seo,http-status-code-301,web-traffic
I am redesigning a gallery which has several different pages and want to make it just one page. I would take the content from each existing page and add it to this one page. I would use 301 re-directs to direct traffic from the old pages to the one page....

Make a 301 redirect with .htaccess

apache,.htaccess,mod-rewrite,http-status-code-301
I want to make redirect 301: http://www.example.com/en/index.html to be http://www.example.com/en/. How I can do this?...

How to 301 redirect URL with PHP parameters to root DIR in .htaccess?

php,.htaccess,mod-rewrite,redirect,http-status-code-301
I have searched how to redirect url with parameters to root dir but I can't get it to work :( This is what the .htaccess code looks like: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> RewriteEngine...

301 redirect to new domain with same url structure

.htaccess,magento,redirect,http-status-code-301
I have a Magento website that is moving to a new domain. Im looking to 301 redirect all pages from the old domain to the new domain keeping same url structure. I've updated the .htaccess file on my old domain with: RewriteEngine On RewriteCond %{HTTP_HOST} ^new-domain.com$ [NC] RewriteRule ^(.*)$ http://new-domain.com/$1...

301 old site to new with lots of url structure changes

wordpress,.htaccess,redirect,http-status-code-301
I will soon be 301'ing my entire site to its new home on a new domain, where it will live as a subdirectory of the main domain. It lives at the root of its current domain. Now, if every single old page had the exact same url structure as every...

Should be a simple 301 redirect

apache,.htaccess,mod-rewrite,redirect,http-status-code-301
What I think should be simple is just not working. I have switched domains Old URL example: digital.photorecommendations.com/recs/2015/01/big-zoom-field-review/ New URL example: photorec.tv/2015/01/big-zoom-field-review/ Really just switching domain and dropping the recs folder from the URL Using http://htaccess.madewithlove.be/ to test and the outputs the correct URL Options +FollowSymlinks RewriteEngine on RewriteBase /recs...

301 redirect whithout append paramenter

regex,.htaccess,http-status-code-301
RedirectPermanent /forum-old-f48.html /forum-neu-f1.html 301 Result: forum-neu-f1.html?f=48&start= Target: Dont append the "?f=48&start=" part. How can I make a stop behind the html? The result should look like this: forum-neu-f1.html thank you!...

Do 301 redirects work on urls that contain query strings?

.htaccess,http-status-code-301
I've searched for this but the answers I've found seem to be around rewriting URLs or for redirecting lots of pages in an entire section and look confusing (lots of regex). We need to add some 301 redirects and everything is working fine except for 13 URLs that contain query...