I currently have a site that contains individual pages for a companies stores as well as standard pages such as about, contact etc.
I have a simple URL rewrite rule in the htaccess file so that these urls are written as
https://sitename.com/manchester
or https://sitename.com/about
instead of https://sitename.com/manchester.php
and https://sitename.com/about.php
etc
As its growing I'm now moving to a database structure for the stores, so instead of creating individual pages for each store I'm serving them up in a query with a select_store.php
file ie https://sitename.com/select_store.php?store=manchester
etc
I want to continue however rewriting the urls as before so still just /manchester
etc but how does this work when I have some URLs that should redirect to select_store.php and others that should simply add .php onto the end of the url?
What's the best way to do this? Do I write individual rewrites for the standard pages? about, contact etc? and then a catch all for anything else to go the select_store.php
?
Or do I redirect everything to select_store and then redirect the likes of about, contact in there? (doesn't sound very SEO friendly though).
My current .htaccess is:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^.]+)$ $1.php [NC,L]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
edited to add additional examples.
currently all pages are suffixed with .php so we have the following:
https://sitename.com/manchester redirects to https://sitename.com/manchester.php
https://sitename.com/liverpool redirects to https://sitename.com/liverpool.php
https://sitename.com/about redirects to https://sitename.com/about.php
I want the stores (in above example manchester & liverpool, but in reality theres a dozen and more adding regularly) to redirect to the likes of:
https://sitename.com/select_shop.php?shop=manchester
while the standard pages (about, contact, menu etc) to continue to redirect as:
https://sitename.com/about.php
https://sitename.com/contact.php
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…