How to disable default url structure (page_id=id) in Wordpress and just use permalink structure - wordpress

I would like to stop WordPress from redirecting the default URL pattern example.com/?page_id=id to the permalink. I would like it to result in a 404.
I don't want that users are able to find single pages by brute forcing my URL structure in a way that they are just trying out URLs with various page_ids.
My goal is to be able to use "hidden" pages with a random slug, so that only people who know the URL will be able to find the corresponding page. But if the pages are accessible via the page id that wouldn't make much sense.
I assume that there is a way to do that in WordPress itself. I don't want to use web server redirects like with the htaccess file, because I want it to be coupled more tightly with the wordpress application. In my experience htaccess files are sometimes messed up by inexperienced users. I want to prevent that the page_id redirections are accidently re-enabled if the htaccess gets messed up unnoticed.

Related

How to redirect (or bring back) /services/ pages after migrating from Wordpress to Shopify?

My problem is that my client has migrated from Wordpress to Shopify, and there were some important pages on the site under the /services/ folder. I wanted to redirect them to their new pages after the migration, which are /pages/ pages.
Shopify has reserved /services/ URLs, however. Therefore I cannot redirect mydomain.com/services/some-services-page to mydomain.com/pages/some-services-page.
Additionally, I cannot change the URLs of the /pages/ pages to /services/ pages.
What would be the next best step here? It seems like a significant limitation of Shopify, as any pages you want to migrate from another CMS that have /services/, apparently can't be redirected, and you lose the SEO value. Those pages are now returning 404 and there doesn't seem to be anything I can do about it, or am I missing something?
I've had some back and forth with Shopify support, which ultimately ends with them saying its a limitation of Shopify and I should submit a feature request. I appreciate any advice you might have.
You can manually create redirects from old relative urls to new ones on shopify by going to [yourstore].myshopify.com/admin/redirects
If you want to track which pages customers are exactly hitting and getting 404's, you can use app Transportr:
https://apps.shopify.com/transportr
It tracks which pages are getting 404, and you can also create redirects directly from an app

Allow access to specific URLs only via .htaccess

I am using a Wordpress website. Recently there has been URL injection on my site that created thousands of URL's and that got indexed on Google. Genuine URL's on my website are 31 only. I need help with .htaccess file (or probably any other way) where as when user access any page other than those valid 31 pages, they either get some error or get redirected to Home Page. There is no fixed pattern of injected URL's. I searched entire Web but could not find an answer. If we can achieve this, we can prevent our site from being blacklisted from Google.

How to Remove redirection on magento site?

There is a problem on my client site.Due to some of the redirections set up for magento.. I am not able to access the wordpress pages.. Whenever I try to access a wordpress page, I am redirected to a magento 404 not found page.... so please let me know how to remove redirection on my magento site??
Your question is ambiguous. Is it the rewriting in .htaccess (or somewhere else) doing the redirect, or do they have redirects in the core_url_rewrite table that conflicts?
I would guess the former. You need to create an alias or location for your Wordpress area that are distinctly different from your Magento area. Often this is accomplished through a separate subdomain, like http://blog.example.com/ or through a suffix like http://www.example.com/blog/.

Converting a static site to a Wordpress site...how to transfer/convert SEO rankings?

I'm going to convert a client's static site, all hand coded HTML pages to Wordpress. They have a bunch of static pages that I'm going to keep as 'pages' in Wordpress. There will be some static content that I'm going to convert into blog entries (and back date them).
How do I transfer their search engine rankings to the new Wordpress site? Some will be a static page converted to a Wordpress 'page' and some will be a static page converted to a blog entry?
Use 301 redirects in your .htaccess in root. All search bots recognize 301 redirects as permanent redirects and don't drop the pages from indexes, but reassign the URL. Put them above the Wordpress rewrite block in .htaccess.
The format is:
Redirect 301 /myoldurl.html http://mydomain.com/newpagename
Notice that the domain is not included in the first URL, only the page name with suffix, assuming it's in root.
Or use WordPress › Redirection « WordPress Plugins to manage redirects inside the WP admin area and log them, too.
You can usually create a permalink structure to match the client's old URL structure.
This is better than the htaccess approach since it is easier to maintain long term. The client won't have to adapt to a new URL structure, and you won't lose any SEO value as you would with 301s ( http://www.marketingpilgrim.com/2010/03/google-confirms-301-redirects-result-in-pagerank-loss.html ).
For example if the old client URL was:
http://www.example.com/blue/widgets.html
you can use the permalink structure of:
/%category%/%postname%.html
You would then create a page (or post) with the post slug of 'widgets' and categorize the page within the 'blue' category which would give you the exact same URL as they had before.
If the old site uses a variety of inconsistent URL formats, this approach is slightly less effective. But you can still do this with the most used URL format, then 301 the other URL formats.
Hope this helps!
In your destination server, you can customize the .htaccess file to redirect old pages URL to new ones. The old URL will still work and the page rank will be kept.
I would consider using Jekyll to do this. It will enable you to create exactly the same site with the same HTML structure. It will give you full control, and therefore not damage SEO. You can add CloudCannon as a CMS and make your site responsive using media queries, like this: http://www.usecue.com/2016/04/21/two-viewports-to-rule-them-all.html. Baby steps will avoid SEO disasters.

Wordpress, why doesn't my blog load the posts if U use the /subfolder domain method?

I have a blog at http://hamids-it.elaosta.com amongst others. If I try to access it from
http://elaosta.com/hamids-it it loads the blog but says it couldn't find the page I wanted.
How do I fix this so I can use either?
I'm guessing you have a standard subdomain install, whereby http://subdomain.example.com is mapped to the directory /example.com/public_html/subdomain?
In any normal circumstance, say with a static HTML file, you can rightly access the same resource at both example.com/subdomain/resource.html and subdomain.example.com/resource.html.
However, in your case, WordPress is parsing the REQUEST_URI and using it to determine what to show.
So in the case of http://elaosta.com/hamids-it, WordPress is actually looking for a page 'hamids-it' - and if it doesn't find it, voila, your 404.
The fix?
You'll need to decide which way you want to access your blog, subdomain or sub-directory, then stick to it.
When you've made a choice, update your General settings in WordPress admin and set both address URL's to either http://hamids-it.elaosta.com or http://elaosta.com/hamids-it.

Resources