Under behavior > site content > all pages there are links such as /shop/christmas.html/index.php which don't exist. The correct url is /shop/christmas.html/. I have created a 301 redirect in case anyone is visiting the index.php page.
Why is analytics appending my pages with index.php?
Related
Here's the scenario, I have a single server and two WordPress sites living in their respective sub-folders:
public_html/site_one/
public_html/site_two/
These sites display as follows:
www.site.com/site_one/
www.site.com/site_two/
The second of those sites has a splash page / landing page:
www.site.com/site_two/landing-page/
...that needs to display in the root of the site:
www.site.com/
I'm aware that there are better ways of achieving this, but I'm restricted to working with how it's currently set up.
Initially I thought I would be able to set up a .htaccess file in the root that rewrites access to the root of the site to display the landing page from site_two, but this isn't working as expected. This is the .htaccess file from the root of the server:
RewriteRule ^$ subfolder/page-slug [L]
This redirects to the site's front page. If I replace page-slug with ?p=1234 then it displays as the correct page but also seems to redirect to the landing page's full URL.
Is there any means of achieving what I'm after?
To clarify:
User visits site.com
URL displays as site.com
Page displayed is site.com/site_two/landing-page/
I've managed to have this behaviour working when not linking to a WordPress page (using a test index.php in 'test-subfolder') but WordPress and its own .htaccess file seems to be confusing matters.
Any help would be appreciated. Is there a way of excluding the landing page from the WP .htaccess file and what is it about the WP .htaccess file that's stopping the page being displayed at the root of the site?
I have a WordPress website and the home page is configured to be the latest posts
What I want is that only the homepage URL that is, e.g. www.test.com redirects to subdomain.test.com and when the user needs to visit the older homepage will only access through test.com/home.
I need this because we will start a campaign in a landing page (subdomain.test.com) today.
But this is only for a few days, it is not a permanent change. How can I achieve this?
you can create a new page in WP where you can redirect to your sub domain.
OR
you can do this to make some changes in .htaccess file
RedirectMatch 301 ^/$ http://newsite.com.in/
add this in .htaccess file
In wordpress, I want to remove page: http://domain.com/2016/03/16/
I mean: when somebody access this page, content is not found 404
There are multiple ways to do this. First and easier is using a plugin. This one for example:
https://wordpress.org/plugins/simple-301-redirects/
Or you can edit your .htaccess file located on the root of your website. Then add a rule to redirect the page you want to the 404 page of your site.
#This allows you to redirect /2016/03/16/ to /404/ (assuming the path to your 404 page is /404/
Redirect 301 /2016/03/16/ http://domain.com/404/
I have been battling redirects all day. We have a customer with an old site, and all the old php links are broken and will redirect you to a 500 error page.
I have tried 3 different 301 redirect plugins all with the same result - regular pages will redirect, and .php pages will not.
I have also tried to redirect from /folder/file(.*) - but with no succes.
This page is made on a WordPress multisite installation so i need a solution where i do not have to add all redirects in the .htaccess file.
I have a WordPress website where the requirement is exactly like below:
WordPress site should be installed on: http://www.mydomain.com/wp/ |
Website homepage should be access from: http://www.mydomain.com/ if someone visits http://www.mydomain.com/wp/ he should be redirect to http://www.mydomain.com/
But when accessing all other inner pages, visitors should follow the URL format:
http://www.mydomain.com/wp/test-page1
http://www.mydomain.com/wp/test-page1
This means I need the main website access from main domain directly but all other inner pages should open under sub-directory as mentioned above.
how can I do that with .htaccess? Thanks
Please look into this website about htaccess redirects: http://htaccess.wordpress.com/2008/09/15/redirecting-urls-in-htaccess/
Aside from that, you will want to have your RewriteBase to be / and not wp so that the user doesn't go to wp subfolder automatically.