clean urls in wordpress - php

Im using page.php in wordpress for making a dynamic page.
Right now Im using photography/?cat=portraits
But I want photography/portraits
Im currently grabbing whatever is in my query string (cat=portraits) and only showing that content.
Where at in wordpress can I set up the routes or permalinks to be formated more simple?

Permalinks can be found under the setting tab from your WordPress admin interface
Follow this tutorial...
http://www.creativecitrus.com/wordpress-development/how-to-get-pretty-urls-in-wordpress
Or theres the Pretty URL plugin....but Ive never used that
http://wordpress.org/plugins/pretty-url/

Login wp-admin
Settings -> permalinks and choose custom structure place this sting and save it
/%category%/%postname%
If you have any problem in saving permalink please copy paste it in htaccess.
Or make it write permission for period.

Related

how create a custom url in wordpress for page with slash like /se/pagename

I added a page in wordpress. Wordpress created a url like
https://mywebsite.com/page-title
but I want to change this url like https://mywebsite.com/se/page-title
My Permalink Settings shows https://mywebsite.com/sample-post/
and website is already indexed on google so I can't change my paramlink setting.
I also tried with htaccess and also from wordpress add_rewrite_rule() but no result is coming.
Any help how can I do this?
The simplest way to make your page url like www.example.com/se/se1 instead of www.example.com/se1 is to create page se and se1 make as child page of se.
With this option you'll saved your wordpress website permalink structure, you'll in not need to change your other pages redirects for google indexing

Set Css based off URL in PHP Wordpress

I am using a website with a structure of www.example.com/blog
I have wordpress installed on the blog folder. I have a featured image that I want to have displayed on the www.example.com/blog but not on the actual blog post www.example.com/blog/post. They both use the same Css and I was wondering if I can do a conditional statement to set the display to none on the post page. I do not have access for the next 4 weeks to FTP in and change the actual code so I need a solution or advice.
I am not sure if I can use a variation of baseurl, as I am not sure how far it will back me out.
Google search didnt help me out too much

Change URL using wordpress redirecting domain

I have my own domain
www.mxm.com (just an example)
and i create other page with this url:
www.mxm.com/testpage1
in the carpet testpage1 i installed wordpress and i redirect to
www.testpage1.com in my cpanel.
So now i can enter www.testpage1.com with no problem but when i click in other menu item like blog the url change to:
www.mxm.com/testpage1/blog
I want to know how to change
www.mxm.com/textpage1/blog
I want to get
www.testpage1.com/blog
I was reading something about editing wp-config.php or wp-setting.php but i didn't get it.
There is a way? I'm kind of newbie using wordpress. Thanks btw.
I finally made it!
I just edit the .htaccess and the table with credentials on my DB and it works.
Other way i found was changing it with the dashboard of Wordpress. In settings there is a field where u can change the address of wordpress and for the website.
This two urls help me a lot:
https://wordpress.org/support/topic/problem-moving-wp-now-only-the-home-page-works
https://wordpress.org/support/topic/redirect-a-domain-to-my-wordpress-url

Custom Permalink with Page Name Wordpress

I have looked all over the place and can't figure out how to get this to work.
I want my urls for blog posts to look like this: "www.website.com/my-page/category-name/blog-post-title"
The issue I am having is that I have a page called "my-page".
So I have a page "www.website.com/my-page/" which is just a standard wordpress page, but I want the url for the blog post to look like it is under that page.
Here is what I have for the permalink so far:
/my-page/%category%/%postname%/
But this doesn't work and gets a 404 error when opening a blog post.
At this point I don't believe it can be fixed through the wordpress gui, so if anyone has any recommendations, it would be appreciated.
Thanks!
Edit: I wanted to add that the permalink works fine if I remove "/my-page" or if I simply modify it so it does not match the page.
First of all you should not use the category in front of your permalinks as it leads to bad performance (and some posts may have multiple categories): http://ottopress.com/2010/category-in-permalinks-considered-harmful/
The second thing is - it should work. I tried with a fresh installation on WordPress and I get the correct results.
Did you flush rewrite rules / save the new permalink structure?
Did you publish a post?
Is your server correctly configured to use permalinks?
Third possibility - if your permalink structure does not work for some reason you can define a custom permalink structure:
https://codex.wordpress.org/Rewrite_API

How to change URL links that were made by WordPress?

I have a WordPress blog. All the post are currently in this convention:
http://www.myblog.com/blog/?p=1442
Now I'd like to change the URL of all posts like this one:
http://www.gomidjets.com/blog/this-is-my-post
While it's quite easy to apply it by changing the blog settings, the big problem is about the links I've placed
in many external website. I can't change them, and I'd like to map the old links to the new links somehow.
Do you know how to do it - if that's possible at all?
Do you have a better solution?
Thank you very much
Wordpress will map all old URL to new one, in case if you provided all URL in their original shape, such as http://example.com/?page_id=80
The answer is: you don't need to do anything.
I believe what you're looking for can be found in the admin panel.
In the admin panel (http://www.your-wordpress-site.com/wp-admin), go to Settings > Permalinks
Login to the admin panel first,
go for the settings->Permalink Settings
Select the format you want.
If you want change the base url for only some posts then you can edit from database.
Try this Redirection wordpress plugin to redirect your old url to your new url.
The URL's should resolve fine because the original URL you're using is the permalink one to my knowledge. If you're wanting end users to be redirected to this url, that's a bit harder.
That aside, I couldn't find any plugins that already did this. What you want to do is check the current URL against the wordpress function get_permalink() and if it doesn't match, redirect to the current permalink URL.

Categories