Home › Forums › BulletProof Security Pro › Adding .html to pages created by plugin with new base name like /portal
- This topic has 42 replies, 2 voices, and was last updated 11 years, 4 months ago by
AITpro Admin.
-
AuthorPosts
-
Andre
ParticipantDoes bring a 403… with the “new” folder created newly.
Dont get it, sorry. I mean, the main domain didnt change on johanneshilfswerk.org also, just that the site before was stored in a folder named “new”
I just dont get it in relevance with the topics above, cause there I made the redirectmatch also to fit old URLs that are in google database to be redirected to new ones.
The URLs with the /component/ in it for example.
To KISS:
RedirectMatchMatch 301 ^/component/ http://www.web-assembler.com
works, why does
RedirectMatch 301 ^/new/$ http://www.johanneshilfswerk.org/
not work?
I ll try it from the root in WP again.Andre
ParticipantThis is a result http://www.johanneshilfswerk.org/new/spenden.html
when clicked on the link in the SERP.
Made from this:
# BEGIN WordPress # Redirect OLD URLs RedirectMatch 301 ^/new/$ http://www.johanneshilfswerk.org/ RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress
AITpro Admin
KeymasterOk I thought you were trying to redirect from an old site that no longer exists. You actually are just trying to redirect a folder that does not exist under a website that does exist and that is not an old website. All you need to do is this in your main site’s johanneshilfswerk.org root .htaccess file.
RedirectMatch 301 ^/new/$ http://www.johanneshilfswerk.org/
AITpro Admin
KeymasterAlso some Hosts require that you add the folder name of the site in your redirect.
http://forum.ait-pro.com/forums/topic/go-daddy-redirect-htaccess-code-no-longer-working/
Andre
ParticipantOkay, but I did like here, thats currently as you said it should be done:
# BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # Redirect OLD URLs RedirectMatch 301 ^/new/$ http://www.johanneshilfswerk.org/ # END WordPress
AITpro Admin
KeymasterWell I am not sure what is wrong. Try this instead.
RewriteEngine On RewriteCond %{REQUEST_URI} ^/new/$ [NC] RewriteRule ^(.*)$ http://www.johanneshilfswerk.org/ [R=301,L]
Andre
Participantnope sorry….
AITpro Admin
KeymasterI just noticed that one of the old links you posted is an .html link so you need to add that in the Redirect rule.
RedirectMatch 301 ^/new/(.*).html$ http://www.johanneshilfswerk.org/
AITpro Admin
KeymasterFYI – your 404.php template file is already handling the redirect so I am not sure what you are trying to do. Unless you are trying to override your Theme 404.php template file and do another redirect instead of letting your Theme 404.php template handle this.
AITpro Admin
KeymasterWhat would make sense to me is if the site was once an HTML site and then you installed a WordPress site and you wanted to redirect old HTML links to new Posts, Pages or Categories where the content from the old HTML page is now in a WordPress Post, Page or Category.
RedirectMatch 301 ^/new/spenden.html$ http://www.johanneshilfswerk.org/spenden/
AITpro Admin
KeymasterHere is a simple solution to do what I think you want to do: This will override your Theme 404.php template file.
Install this plugin: Page Links To >>> http://wordpress.org/plugins/page-links-to/
Create a new Page called “new”. Use the Page Links To plugin and point the URL to this site’s home page.
Your redirect rules will now work correctly.
RedirectMatch 301 ^/new/(.*).html$ http://www.johanneshilfswerk.org/ or RedirectMatch 301 ^/new/(.*).html$ http://www.johanneshilfswerk.org/new/
Andre
ParticipantHi,
well …
I explain from the beginning, sorry for me being the storyteller again.
Long time an old site of a Joomla was existing, badly developed , J 1.5 still and it was installed in /htdocs/new , not in the root /htdocs.Then google of course fetched those links all the time, also wikipedia and else.
We developed a new site on WordPress and installed it on a new webhost with domain transfer to our provider and installed it in the root.
No folder /new existing anymore.Then I wanted to do the same thing as I did above with web-assembler.com where I also had a joomla site before, which link structure is not existing anymore, where I made the redirectmatchs with your help and where it was working fine.
I dont want the links to go to a 404 at all, you know? I want the old links to land on the appropriate site or at least on the standard homepage ( in the case of johanneshilfswerk I do want all old links to land on homepage simply)
I dont understand the difference between web-assembler.com where it worked and johanneshilfswerk where the exact same code for the exact same goal does not work.
I am really confused now.Update: I installed the plugin and at least the /new is now redirecting right.
I also addedRedirectMatch 301 ^/new/(.*).html$ http://www.johanneshilfswerk.org/
to htaccess but old links like /new/spenden go to 404 still.
I am glad that you try to help also because this doesnt have to do with BPS at all.
But the situation leaves me blind.Thanks.
AndreAITpro Admin
KeymasterI checked the site again. The new WordPress site has a spenden page/URL (donations/donate page in English). So logically you would want the old HTML spenden.html page to redirect to the new WordPress spenden page. Remove the redirect that you added with Pages Links To plugin that redirects “new” to this website’s home page.
RedirectMatch 301 ^/new/spenden.html$ http://www.johanneshilfswerk.org/spenden/
-
AuthorPosts
- You must be logged in to reply to this topic.