I am switching system from a MVC to a custom code system. Currently we are using this format for urls:
index.php?part=CAPACITOR&type=CERAMIC&model=0805&page=spec
I need now to rewrite urls like to be more nice for user like
mysitecom/CAPACITOR/
mysitecom/CAPACITOR/CERAMIC/
mysitecom/CAPACITOR/CERAMIC/0805/spec.html#2
where #1 and #2 are the pages loaded in jquery. The developer use the old way using /index.php/CAPACITOR/CERAMIC/0805/spec.html
Because I don't think using the index.php in the url is good, what can I do to make this better?
In a website migration, a website undergoes substantial URL, structure, content, UX, design, or platform changes. It could be everything from updating the layout of your website to changing the URL structure, or moving your website to a new domain or content management system (CMS).
A site migration is a term broadly used by SEO professionals to describe any event whereby a website undergoes substantial changes in areas that can significantly affect search engine visibility — typically changes to the site's location, platform, structure, content, design, or UX.
So, Does Website Migration Affect SEO? Any server change carries a slight SEO risk with or without modifications to your website, but that's not necessarily a bad thing. You see, migrations primarily affect site speed. So if you're migrating to a host like A2 Hosting, you'll notice increased site speed.
Here's what you need to use
RewriteEngine On
RewriteBase /
RewriteRule ^([a-z0-9\-_]+)/?$ index.php?part=$1&type=all&model=all&page=index [L,NC]
RewriteRule ^([a-z0-9\-_]+)/([a-z0-9\-_]+)/?$ index.php?part=$1&type=$2&model=all&page=index [L,NC]
RewriteRule ^([a-z0-9\-_]+)/([a-z0-9\-_]+)/([a-z0-9\-_]+)/?$ index.php?part=$1&type=$2&model=$3&page=index [L,NC]
RewriteRule ^([a-z0-9\-_]+)/([a-z0-9\-_]+)/([a-z0-9\-_]+)/([a-z0-9\-_\.]+)\.html$ index.php?part=$1&type=$2&model=$3&page=$4 [L,NC]
So when a folder (example CERAMIC) is not provided you can add a flag to load all, same idea for model. It means that if only the first part is provided only he first rule will be used. As of the page.html
by default you can load the index.
Now, a-z0-9\-_
means any letters, numbers, dashes and underscore ONLY. You can use ([^/]+)
if you prefer that will allow you to use more characters.
The L mean last
meaning if the rule match, it will stop. NC means non case so A = a or ABC = abc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With