cancel
Showing results for 
Search instead for 
Did you mean: 

Help with .htaccess - html to php

oakbydesign
Grafter
Posts: 27
Registered: ‎01-06-2014

Help with .htaccess - html to php

Hi
Looking for a simple code for the .htaccess file.
Old site was hosting on plus net under /htdocs all using html files, no problems
New site, using WP and hosting on ccvii.username.plus.com and using .php files, no problem
Need the code to redirect ALL the old html files, now indexed with google to point to the homepage index.php
Ideally each old page to the new php page but if all went to the index.php file, this will be ok.
Many thanks
Richard
9 REPLIES 9
bobpullen
Community Gaffer
Community Gaffer
Posts: 14,877
Thanks: 2,478
Fixes: 168
Registered: ‎04-04-2007

Re: Help with .htaccess - html to php

Hi Richard,
How many indexed links are we talking about? If there's only a handful then you could set up 301 redirects by adding entries like this to the .htaccess file in your /public directory:
Redirect 301 [old file path] [new file path]

e.g. this would redirect direct attempts to access your site using the address http://invalid.tld/path to the new address http://invalid.tld/target:
Redirect 301 /path /target

PS. In case you were wondering, I'm the same Bob Pullen that responded to your support ticket earlier. Our helpdesk staff can't typically help with web design/scripting stuff because it's outside of their remit. That's why I thought it best I post here rather than in reply to your ticket.

Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵

oakbydesign
Grafter
Posts: 27
Registered: ‎01-06-2014

Re: Help with .htaccess - html to php

Bob
Hi, there are about 80 html listed.
I have a complete list generated by some site map software and can use the txt file to do the redirects.
This didn't work before and I tried the following
Redirect 301 http://www.oakbydesign.co.uk/oldfolder/oldfile.html http://www.oakbydesign.co.uk/newfolder
If I put the redirect http://www.oakbydesign.co.uk/newfolder into any address bar, the relevant page is shown but the actual redirect doesn't seem to generate a 404 error.
I will try and copy and paste the htaccess content later on.
Thanks
Richard
oakbydesign
Grafter
Posts: 27
Registered: ‎01-06-2014

Re: Help with .htaccess - html to php

See here
Redirect 301 http://www.oakbydesign.co.uk/oak-interiors/oak-doors/oak-doors.html http://www.oakbydesign.co.uk/products/interiors/oak-doors-frames-architrave/
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ -
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
</IfModule>
# END WordPress

I have also tried just redirecting the folder
Redirect 301 http://www.oakbydesign.co.uk/oak-interiors/oak-doors/ http://www.oakbydesign.co.uk/products/interiors/oak-doors-frames-architrave/
Is it something to do with the index.php file?
I fult understand html but php looses me a bit.
Thanks
Richard
bobpullen
Community Gaffer
Community Gaffer
Posts: 14,877
Thanks: 2,478
Fixes: 168
Registered: ‎04-04-2007

Re: Help with .htaccess - html to php

Both of those should do the trick, however you don't necessarily need to use the full URL. I've made some changes to your .htaccess file, added some comments to it and both of the redirects from your previous post should now be working.
Let me know if you're still unsure about anything.

Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵

oakbydesign
Grafter
Posts: 27
Registered: ‎01-06-2014

Re: Help with .htaccess - html to php

Bob
Thanks for this.
I think it may not have worked before as the full url was put it.
The door folder you have entered on the htaccess file does work, thanks
I will put some others on later to see their effect
Cheers
Richard
oakbydesign
Grafter
Posts: 27
Registered: ‎01-06-2014

Re: Help with .htaccess - html to php

Not sure whether to start a new thread but here goes.
Everything is working  Cheesy
But....
When I login to phpadmin, it doesn't show any databases.  There obviously is, as the website works.
I thought about uninstalling and reinstalling phpadmin but the one and only password I have is not recognised.
Can anyone uninstall it for me or know how to request a password reset?
Thanks
bobpullen
Community Gaffer
Community Gaffer
Posts: 14,877
Thanks: 2,478
Fixes: 168
Registered: ‎04-04-2007

Re: Help with .htaccess - html to php

Quote from: oakbydesign
Can anyone uninstall it for me or know how to request a password reset?

Your install is pointing to a different database to the one your site is now using.
There was a database under the MySQL Manager instance for your .plus.com domain (phpMyAdmin was pointing here) and a database under the MySQL Manager instance for your .co.uk domain (your website was pointing here). I've now deleted the former to avoid any confusion.
Uninstalling the phpMyAdmin interface is as simple as deleting/renaming the /private/phpmyadmin directory from your webspace. This allows you to reinstall the application using the Control Panel. I've done this on your behalf, creating another install under your .co.uk domain. Problem is, the database still isn't visible Huh
I's suggest you avoid making any other changes whilst I refer the issue to Hostopia.
In the interim, you might want to consider using something like Adminer to manage your database.

Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵

spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: Help with .htaccess - html to php

The phpMyAdmin not working problem affects other users, myself included (ticket #87484193) and this topic. In my case the problem might have arisen when I lost MySQL access at 00:32 on Thursday 19/06/2014. I raised ticket #87270607 concerning that.
WordPress access worked again when I checked on Thursday afternoon so I assumed the problem had been fixed. I closed the ticket on Friday afternoon still without a response.
It wasn't until the weekend that I tried to use phpMyAdmin and found it wasn't working.
David
David
bobpullen
Community Gaffer
Community Gaffer
Posts: 14,877
Thanks: 2,478
Fixes: 168
Registered: ‎04-04-2007

Re: Help with .htaccess - html to php

Thanks David, I'll take a look at that now.

Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵