Need someone to fix a Wordpress Slug/URL issue

Status
Not open for further replies.

GNews

White Hat Genius
BuSo Pro
Joined
Nov 7, 2016
Messages
1,563
Likes
435
Degree
2
I Need someone to fix a Wordpress Slug/URL issue.

The coder I had, was supposed to set up links to direct to the folders (ie: site.com/folder-name/)
This is because I have a ton of HTML content to convert to Wordpress and that's the be solution

He's instead made it so the links/urls go ( site.com/folder-name.html) and my site was never set up this way to begin with.

Anyone able to handle this?
 
To clarify, are you saying that you have folders like site.com/folder-name/ which contain a bunch of HTML files that you want crawled and indexed as pages, and those page URLs still end in .html? That you then intend on moving into Wordpress?

If that's the case you'll need to do some (assuming you're on an Apache server) .htaccess work to individually 301 redirect those folder-name.html folder pages to /folder-name/. You can't do a catch all because it'll also redirect the individual posts with .html on the end too.

Alternatively this could be managed with a plugin that stores redirects in the database. It's a bit slower, and you'll have interference from the past .htaccess work.

Once you get this done you'll need to then start 301 redirecting each individual page to the non-.html version as you convert them into Wordpress.
 
No, i pretty much saw the future of Web design coming by 2006

All my links went to a subfolder b/c it automatically redirects to the 'index' file.. .which was index.html back when I doing it myself.

But now I can just replace those pages with wordpress posts, if the URL structure is fixed properly.

Whatever post I add, I just need the URL to show a "/" instead of ".html" at the end of the url structure

Everything else is fine for now.
 
So your actual posts before redirect live at /somefolder/index.html
And your coder redirected them to /somefolder.html
And you want them to be /somefolder/

Would that be correct?
 
Close
So your actual posts before redirect live at /somefolder/index.html
And your coder redirected them to /somefolder.html
And you want them to be /somefolder/

Would that be correct?

Close.

Before , all my pages were all linked to /some-folder-name/
Now, my code made it lnk to /some-folder-name.html
I want all my WP posts url to be back to /some-folder-name/

and i want all my new posts to launch as /some-folder-name/
 
I'm guessing you want to still use your current code that uses the html extension but you want it to show as the directory like: "/some-folder-name/"

You can do that using mod_rewrite assuming your on apache.
You may need to activate the module.

For example the following .htaccess line will tell the server if you visit "/some-folder-name/" to show what's on "some-folder-name.html".
Code:
RewriteEngine on
RewriteRule ^some-folder-name/ some-folder-name.html [NC]
Note that this is not redirecting to "some-folder-name.html", rather it is representing "/some-folder-name/" as "some-folder-name.html". If you have internal links to your .html version you will want to change them to the directory version. You will also want to 301 the .html versions to the new directory version. Otherwise you would potentially be able to see both urls depending on the original request.

You can use regex to help make the rules. Not sure how many urls this impacts on your site but you could do something like:
Code:
RewriteEngine on
RewriteRule ^([A-Za-z0-9-]+)/?$ $1.html [NC]
This will rewrite all .html files to a directory format.

If you only want to do this to a handful of urls you could use a more strict rule:
Code:
RewriteEngine on
RewriteRule ^(some-folder|another-folder|and-another)/?$ $1.html [NC]
Keep in mind this will effect your links to everything on those pages, html links, images, css, etc... make sure they link to your domain root or use the correct relative path. ex) /images/logo.png
 
I'm guessing you want to still use your current code that uses the html extension but you want it to show as the directory like: "/some-folder-name/"

You can do that using mod_rewrite assuming your on apache.
You may need to activate the module.

For example the following .htaccess line will tell the server if you visit "/some-folder-name/" to show what's on "some-folder-name.html".
Code:
RewriteEngine on
RewriteRule ^some-folder-name/ some-folder-name.html [NC]
Note that this is not redirecting to "some-folder-name.html", rather it is representing "/some-folder-name/" as "some-folder-name.html". If you have internal links to your .html version you will want to change them to the directory version. You will also want to 301 the .html versions to the new directory version. Otherwise you would potentially be able to see both urls depending on the original request.

You can use regex to help make the rules. Not sure how many urls this impacts on your site but you could do something like:
Code:
RewriteEngine on
RewriteRule ^([A-Za-z0-9-]+)/?$ $1.html [NC]
This will rewrite all .html files to a directory format.

If you only want to do this to a handful of urls you could use a more strict rule:
Code:
RewriteEngine on
RewriteRule ^(some-folder|another-folder|and-another)/?$ $1.html [NC]
Keep in mind this will effect your links to everything on those pages, html links, images, css, etc... make sure they link to your domain root or use the correct relative path. ex) /images/logo.png

I need a permanent solution that will make all my old links work and none of the backlinks to the pages get lost in translation.
 
I need a permanent solution that will make all my old links work and none of the backlinks to the pages get lost in translation.
That would be a permanent solution. It would preserve and consolidate backlinks to one URL structure as long as you:
  1. Create the rewrite rules
  2. Update your internal links to reflect the new path
  3. Redirect all old html urls to the new directory version
Or update your site structure entirely to the directory format, create 301 redirects and be done with it.
 
That would be a permanent solution. It would preserve and consolidate backlinks to one URL structure as long as you:
  1. Create the rewrite rules
  2. Update your internal links to reflect the new path
  3. Redirect all old html urls to the new directory version
Or update your site structure entirely to the directory format, create 301 redirects and be done with it.

I'd like to hire a professional. Someone I can trust to perform some small updates.
 
The reason everyone is telling you how to do it but not jumping at the opportunity is because this is a dead simple job that's not worth the time it'll take or the money you'll pay. This, however, is the perfect job for Fiverr or Upwork. For $5 to $10 you can have it done in 10 minutes or so from a random stranger that doesn't know your operation or care because they're too busy grinding out pennies on one of those freelancer sites.
 
The reason everyone is telling you how to do it but not jumping at the opportunity is because this is a dead simple job that's not worth the time it'll take or the money you'll pay. This, however, is the perfect job for Fiverr or Upwork. For $5 to $10 you can have it done in 10 minutes or so from a random stranger that doesn't know your operation or care because they're too busy grinding out pennies on one of those freelancer sites.

Well, if the person is actually skilled; I actually have 2 more websites to build & a friend who needs their eCommerce site revamped.

Trying to build a relationship from a source I trust. BuSo has given me great experiences.

LIFE CHANGING experiences.
 
Found someone. Fixed.
 
Status
Not open for further replies.
Back