I have a custom post typed called Uploads on my WP site which (using v3.1) has an index archive at this url: http://domain.com/uploads
Now because this is created automatically by WordPress and not using a page like in previous versions of WP I am unable to create a sub-page like so: http://domain.com/uploads/my-page
How can I create a page and change it's url to fake it so it looks a child page of uploads?
Thanks
If you have just one page ... try creating your own plugin:
This is for rewrite rule
This is for rewrite params
And do not forget to disable Canonical redirection
This is faster then searching for working solution ... just if you have 1,2,3 custom urls.
This worked for me: http://wordpress.org/extend/plugins/custom-permalinks/
Did you try the url edit function, in edit page?
Related
i have tried to load a flat panel write on PHP i put in a wordpress theme.
for alone the script run great but i want run that on wordpress theme.
problem in them routing. for example:
site/wp-content/themes/admin/dashboard/
site/wp-content/themes/admin/dashboard/sprofile
site/wp-content/themes/admin/dashboard/rprofile
can not access above route.
i think this solve with .htaccess file but don't know how !?
is there any way?!
If you're using wordpress you may want to create a shortcode for your script but, in case you don't want to, you can also use .htaccess with the rewrite module to redirect a url and access your panel.
Here are two examples that I hope will help you:
.htaccess rewrite examples
Shortcode examples
If I understood your situation correctly, you want to run a piece of PHP code which prints stuff inside the page as a feature in your WP theme. Not knowing the details, i can give you a couple of ideas:
If you need to embed that in an existing page (or s a new page itself), you need to create a template/template part and manage it trough wordpress's apis (which includes, as said, shipping it as a template part or a template itself, See codex)
If you need to create a new page with custom logic which is more suitable to be written as a plugin, consider adding a rewrite rule to a custom route (See this section of the codex and take a look at this article)
that is i want
when enter to
site/wp-content/themes/admin/dashboard/login
rewrite to
site/wp-content/themes/admin/dashboard/?url=login
login not static
now i use this to htaccess but don't work :
RewriteRule ^wp-content/themes/bluetheme/dashboard/(.*)$ /subdirectory/wp-content/themes/bluetheme/dashboard?url=$1 [L,NC,QSA]
Don't try cheating on WP, by smuggling your php file in some dir and trying to call it from there, by tweaking .htaccess file and similar. Look for system way to create custom WP page. I.e.
https://www.wpbeginner.com/wp-themes/how-to-create-a-custom-page-in-wordpress/
In wordpress I want to add the Get parameters for some pages
currently my paramlink settings are are to example.com/pagename/
what I want do is example.com/pagename?a=1&b=2 add these two parameters only in pagename page
I tried to do like this in my .htacess
RewriteRule ^pagename/([^/]+)$ pagename?a=1&b=2
But this is not working
is there any way I can do it in my wordpress website
I am using wordpress 5.1
Use add_query_arg functionalities to do this, for ref - code doc
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
I try to create a custom search page in a Wordpress website. I read a few tutorials on Google and I have almost finished with it.
My theme uses the index.php page for the search results. So, I duplicated it, rename it to searchpage.php, made it a template and created a page with this template in Wordpress admin.
Then, I changed the action on the Search form to use the new page of /search.
If I manually try the /search/test/ it works. If I use the widget it redirect to /search/?s=test and returns a 404 page.
Is there any way to make both works or prevent the widget to use the second?
Also, the /search/test still uses the index.php layout instead of the searchpage.php
In order to overwrite index.php as the default search results page you'll need to name your file search.php
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.