logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Permalinks - when rewrite mod problem
Author
Nate1



Joined: 05 Sep 2015
Posts: 5
Location: New Zealand, Wanaka

PostPosted: Sat 05 Sep '15 9:52    Post subject: Permalinks - when rewrite mod problem Reply with quote

Hello,

I'm configuring a service for many word press installs, (First time) I have the server operating, db etc, word press is working (DNS not pointing there yet) however the permalinks won't run, Ive attempted modifying the rewrite mod - however that causes a redirect permanently issue.

Ive tried a few things, AllowOveride=All, variant htaccess mods (htaccess configuration from here: https://gist.github.com/oazabir/5637290)

Ive also tried my previous htaccess entries, which also don't work
# 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 WordPress

How do I fix this issue? enabling the rewrite mod causes the problem, for a small period I had other pages responding on the Routed path but all the resources where producing 301s, meaning the loading appeared to take forever, but was continuously loading.

Also Is this something I can modify at the server level instead at the website directory (all sites instead of each site)

Thanks
Back to top
Nate1



Joined: 05 Sep 2015
Posts: 5
Location: New Zealand, Wanaka

PostPosted: Sat 05 Sep '15 10:03    Post subject: All resources are responding as permenantly move 301 Reply with quote

A large number (I suspect all) static resources are responding with 301s

e.g.
GET layerslider.transitions.js?ver=5.3.2
301 Moved Permanently

which loops continuously, is that caused by the entry in the .hraccess file.

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(^/wp-.*)
RewriteCond %{REQUEST_FILENAME} !\.(css|js|html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$ [NC]
RewriteRule . /index.php [L]

#RewriteRule .* - [L]
Back to top
Nate1



Joined: 05 Sep 2015
Posts: 5
Location: New Zealand, Wanaka

PostPosted: Sat 05 Sep '15 10:07    Post subject: So rewrite is working, Reply with quote

Rewrite is working, but resources are not being loaded - due to 301.
Back to top
Nate1



Joined: 05 Sep 2015
Posts: 5
Location: New Zealand, Wanaka

PostPosted: Sat 05 Sep '15 10:14    Post subject: Cannot access admin Reply with quote

Also I cannot access admin when mod_rewrite is enabled
http://www.example.com/wp-admin/plugins.php
Back to top
Nate1



Joined: 05 Sep 2015
Posts: 5
Location: New Zealand, Wanaka

PostPosted: Sun 06 Sep '15 4:09    Post subject: SOLVED: Reply with quote

SOLVED: So issue is:
Ive moved the site from a server where no-www redirects to www.
The New Server defaults to www redirects to no-www
I had no alias in my hosts file to tell domain.com to point to the new server, once setting this up works fine.

From the htaccess file linked here, needed to enable a few modules then comment option 1
# Rewrite "www.example.com -> example.com".
and enable
# Rewrite "example.com -> http://www.example.com".
http://www.codeproject.com/Articles/597944/HowplustoplussetupplusaplusrockplussolidplusVMplus
Back to top


Reply to topic   Topic: Permalinks - when rewrite mod problem View previous topic :: View next topic
Post new topic   Forum Index -> Apache