htaccess - WordPress pages break with custom permalink settings (theme directory not output)

admin2025-01-07  6

We have a site under development which works fine locally, however when uploaded to our server using the permalink settings %postname% the correct URLs are rendered in the menu but in all pages other than home no WP theme URL is output

for example: / works fine / does not output the theme directory so renders unstyled HTML

This works fine under default settings p?=123 etc but we need proper URLs.

This is hosted with 123-reg who don't believe there is a server issue - previously similar has happened if .htaccess is not being read by the server but I'm told this is not the case.

Any help appreciated!

We have a site under development which works fine locally, however when uploaded to our server using the permalink settings %postname% the correct URLs are rendered in the menu but in all pages other than home no WP theme URL is output

for example: http://distinctivepeople.co.uk/wp/ works fine http://distinctivepeople.co.uk/wp/who-we-are/ does not output the theme directory so renders unstyled HTML

This works fine under default settings p?=123 etc but we need proper URLs.

This is hosted with 123-reg who don't believe there is a server issue - previously similar has happened if .htaccess is not being read by the server but I'm told this is not the case.

Any help appreciated!

Share Improve this question asked Oct 14, 2016 at 15:08 Andy KleemanAndy Kleeman 231 silver badge3 bronze badges 14
  • How have you included your stylesheet link? – Andy Macaulay-Brook Commented Oct 14, 2016 at 15:16
  • It's a css problem, look at your source code, it's look like the theme path wasn't set. – Benoti Commented Oct 14, 2016 at 15:19
  • <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/assets/css/dp.css" media="all" /> – Andy Kleeman Commented Oct 14, 2016 at 15:19
  • it is set. as above, see the homepage - works fine, also works on these pages under default permalink settings but not for custom settings – Andy Kleeman Commented Oct 14, 2016 at 15:20
  • it's getting the index file from the root instead of any files from the theme directory when these permalink settings are set – Andy Kleeman Commented Oct 14, 2016 at 15:25
 |  Show 9 more comments

1 Answer 1

Reset to default 0

This was resolved with the help of @AndyMacaulay-Brook

The htaccess had some incorrect (non-wp declarations) which when removed solved the issue:

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase / 
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
</IfModule> 

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase /wp/ 
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /wp/index.php [L] 
</IfModule> 
# END WordPress 

Removing everything outside of the WP declarations fixed the issue

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736260269a653.html

最新回复(0)