Pretty Permalinks not working
-
Plugin installed but the pretty permalinks aren’t working. I can see the AMP version of the site by using the ?amp=1 URL but the /amp/ version just gives me the normal site.
Any ideas?
-
No one else facing this problem? I’ve tried re-saving Permalinks in the settings and the new version doesn’t resolve the issue.
A problem with my .htaccess perhaps?
http://www.zerohanger.com/hogan-puts-contract-talks-on-hold-3703/amp/
Do you have any special rewrite rules in place?
# BEGIN W3TC Page Cache core <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP:Accept-Encoding} gzip RewriteRule .* - [E=W3TC_ENC:_gzip] RewriteCond %{HTTP_COOKIE} w3tc_preview [NC] RewriteRule .* - [E=W3TC_PREVIEW:_preview] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{QUERY_STRING} ="" RewriteCond %{REQUEST_URI} \/$ RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC] RewriteCond %{HTTP_USER_AGENT} !(iPhone|iPod|Android|BB10|BlackBerry|webOS|IEMobile/7\.0|IEMobile/9\.0|IEMobile/10\.0|MSIE\ 10\.0|iPad|PlayBook|Xoom|P160U|SCH\-I800|Nexus\ 7|Touch) [NC] RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" -f RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" [L] </IfModule> # END W3TC Page Cache core # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPressThat are the only ReWrite rules in my .htaccess
Those look fine. What does your permalink structure look like? I’m also seeing two
<link rel=amphtmltags on your posts which is a bit odd. Are you inserting one manually or using another AMP plugin?Ahhh yes, I was. I have now removed the manual insertion.
Permalinks are custom structure:
/%postname%-%post_id%/Hi, just some feedback re schema for permalinks:
that permalink structure works for me on various sites without issue, with Linux/Apache/CentOS/Plesk environment:/%postname%-%post_id%/like here
http://musewire.com/continuucon-2016-the-first-continuum-fingerboard-conference-announced-8464/amp/(unlinked to avoid spammy posting …)
I suspect the caching setup, but that is very glib of me. But that is the one thing we’re not running since we are doing some caching on server side, but will be testing the Automattic branded cache soon.
We do use W3 Total Cache and Varnish setup. Perhaps it’s causing issues?
The same problem here!
I use varnish for server side cache.
I have installed and activated the plugin. I re-saved the permalinks. Tried adding the ?amp=1 in the end of my links but nothing happens!
My problem is that if I add ?amp=1 or /amp/ in the end of a post
ex. http://bigdrop.gr/10-mithi-gia-to-seo/?amp=1
or
http://bigdrop.gr/10-mithi-gia-to-seo/amp
both leads to the main article which is:
http://bigdrop.gr/10-mithi-gia-to-seo/Any clue why this is might happening?
Thank you!The reason I was suspecting a cache plugin as they tend to add additional rewrite rules to htaccess, and presumably the idea is to load the request from the cache vs from the WP dbase / dynamic call/request – and so, the cache is working “properly” to redirect the request to cached version because it has no entry for /amp/ on the end.
It’s possible that WP Super Cache has a hook/handler/entry for AMP, since it’s also from Automattic .. dunno. I do know a *lot* of my pals have moved to WPSC for compatibility with a LOT of various WP stuff.
Could be wrong, but that is a “technical guess” on my part.
Hmmm, have done some trouble shooting and doesn’t look like it’s any caching causing the problem.
I don’t actually use Varnish on that domain and disabling W3 Total Cache doesn’t resolve the issue either.
The topic ‘Pretty Permalinks not working’ is closed to new replies.