Symfony routing to WordPress' index.php - php

my following question is quiet stupid I think, but I couldn't find anything like this, which would have helped me... o.O
I want to create a route to my WordPress index.php and to wp-admin.
When somebody opens mywebsite.com/wordpress he should get redirected to the wordpress site. If one of the admins opens mywebsite.com/admin he should get to the login view of WordPress.
What do I have to do in routing.yml??
Thank you
Jannes

I think this might be what you're looking for : http://symfony.com/doc/current/cookbook/routing/redirect_in_config.html

Related

Wordpress redirect from URL with BuddyPress

I am using the plugin BuddyPress on my WordPress site and when the user clicks on their profile they are redirected to the URL "/members/USERNAME/profile/home/". However, I do not want this page to be there and so I would like the profile 'landing' page to be the URL "/members/USERNAME/activity/".
I am not experienced with WordPress or PHP but I attempted to code a redirect for this when the user ends up on the 'home' page which is placed within my BuddyPress members/single/home.php file within my child theme:
$redirect_url_home = get_home_url();
$redirect_url_home_tt = $redirect_url_home;
$username_redirect_tt = wp_get_current_user();
$new_redirect_slug = "'/members/'.$username_redirect_tt->user_login.'/activity/'";
$redirect_url_home_tt. = $new_redirect_slug;
echo($redirect_url_home_tt);
wp_safe_redirect( $redirect_url_home_tt );
This code doesn't work but that was my thinking of how to solve my problem and I'm sure there is an easier/nicer way to do what I would like, maybe even without a coded redirect and within BuddyPress itself? I have tried using their forum/documentation for answers but haven't had a reply or found anything useful.
As I say I have no experience with this sort of stuff so any help would be greatly appreciated! Also, to add, I cannot link the site as it is currently on a localhost.
Thanks!
This question was originally posted on StackExchange here (https://wordpress.stackexchange.com/questions/386414/wordpress-redirect-from-url-with-buddypress) but I have had no reply as of yet and I would really like one so hopefully, this reaches someone that can help!

How to locate the homepage of wordpress

Sorry for posting my question here as I don't know where I should post it.
I am new to wordpress and now I need to amend the main webpage.
I logged in GoDaddy and I tried to find some files like index.html, index.php, but they are not the page I want.
Which file should I find?
Can you please help?
Thanks
First check which theme you have selected from admin panel
then in folder look for 'themes/YOUR_THEME_NAME'
There look for pages front-page.php/home.php/index.php _ atleast one of these will be present.
Modif6y that file according to your need.

Why does the page in WordPress is showing 404 errror?

I could create pages in WordPress, but whenever I take that corresponding URL
eg:BaseUrl/page-slug/
the page is not loading, also showing a 404 error. I set the permalink
hostname/%postname%/
I have used the same theme in my local it was working fine but in the server, it behaves like this. Please anyone can help me?
Would you please save permalin?
Step 1 : Goto wp-admin->setting->permalinks
Steps 2 : After save changes
This usually happens if something goes wrong with rewrite rules or your .htaccess file gets deleted. You should fix your permalink settings.
Go to Settings> Permalinks and click the Save Changes button. That should solve your problem!

How to allow specific URL in WordPress

I need a little bit help on WordPress URL.
In Wordpress Backend, I have One page and the page slug is: listing-detail
When I try below URL into the browser it's working as per my expectation.
xyz.net/listing-detail/576905/
But When I try below URL it's giving me 404 page.
xyz.net/listing-detail/576905/abc
I have to allow xyz.net/listing-detail/576905/abc URL to call same as xyz.net/listing-detail/576905/
How can I achieve this thing in WordPress?
Can anyone help to regard this issue?
Thanks in Advance.
You can use the WordPress Rewrite API to specify new endpoints and tell WordPress what to display for them.

.htaccess and mod-rewrite for my wordpress admin panel

Any ideas on how to rewrite my admin URLS would greatly be appreciated.
I have created some menus using functions.php and they are working properly but I need a way that I can use on my .htacess to re-write my code.
The original URL is displaying like this:
http://www.website.com/wp-admin/admin.php?page=for_buyers
I want it to display like this:
http://www.website.com/wp-admin/menu-sample/submenu-sample/
Thank you!
I don't know how many pages you have to rewrite the urls for but you could do 301 redirects which be easy for a few pages but a bit dirty.. Since it sounds like you already have the new links set-up
Otherwise you need to look through their php code..
http://www.website.com/wp-admin/admin.php?page=for_buyers
Their passing info through the url to direct the user to the correct page.. So they clicked this link, and they set it up so that it goes to page=for_buyers. I would bet this code is in the admin.php, but you would most likely need to edit other php files that get redirected to this admin.php file..
I might be missing your question completely.. Let me know..
RewriteEngine on
redirect 301 /category/product-line/samplepage.htm http://websitename.com/newpage.htm
so the page you are redirecting, just take awaY the domain.com part and start with the slash, then a space, then the full html path of the page you are redirecting to.. start with one and give it a min and see if it works.. then go from there.. the htaccess file should be in your main directory.. wordpress should already have one created and you just add to the end of it..
Good luck -Pat
Go to your settings > permalinks and select Post name
Thanks.

Categories