Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have tried to change mode of .htaccess in wordpress folder to 644. Yet, I get

Not Found
The requested URL /wordpress/features/ was not found on this server.

I keep reading about rearranging my .htaccess to get Permalinks working. Unable to understand.

Here are the details of my .htaccess

# Comment
DirectoryIndex index.html index.htm index.php
<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /wordpress/
        RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+
        RewriteRule .* - [E=no-gzip:1]
</IfModule>
# BEGIN FlexiCache Standalone
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST}        localhost$
    RewriteCond %{REQUEST_METHOD}   GET
    RewriteCond %{REQUEST_URI}      !^/wp-
    RewriteCond %{HTTP_COOKIE}      !(wordpress_logged_in|comment_author|wp-postpass)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d [OR]
    RewriteCond %{REQUEST_URI}      ^/$
    RewriteRule ^(.*)               wp-content/plugins/flexicache/standalone.php [L]
</IfModule>
# END FlexiCache Standalone
# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
    <IfModule mod_setenvif.c>
        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
    </IfModule>
    <IfModule mod_headers.c>
        Header append Vary User-Agent env=!dont-vary
    </IfModule>
    <IfModule mod_filter.c>
        AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
    </IfModule>
</IfModule>
<FilesMatch "\.(css|js|htc|CSS|JS|HTC)$">
    <IfModule mod_headers.c>
        Header set Pragma "public"
        Header set Cache-Control "max-age=31536000, public, must-revalidate, proxy-revalidate"
    </IfModule>
    FileETag None
    <IfModule mod_headers.c>
         Header set X-Powered-By "W3 Total Cache/0.9.2.4"
    </IfModule>
</FilesMatch>
<FilesMatch "\.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|HTML|HTM|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|XML)$">
    <IfModule mod_headers.c>
        Header set Pragma "public"
        Header set Cache-Control "max-age=3600, public, must-revalidate, proxy-revalidate"
    </IfModule>
    FileETag None
    <IfModule mod_headers.c>
         Header set X-Powered-By "W3 Total Cache/0.9.2.4"
    </IfModule>
</FilesMatch>
<FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EOT|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SVG|SVGZ|SWF|TAR|TIF|TIFF|TTF|TTC|WAV|WMA|WRI|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
    <IfModule mod_headers.c>
        Header set Pragma "public"
        Header set Cache-Control "max-age=31536000, public, must-revalidate, proxy-revalidate"
    </IfModule>
    FileETag None
    <IfModule mod_headers.c>
         Header set X-Powered-By "W3 Total Cache/0.9.2.4"
    </IfModule>
</FilesMatch>
# END W3TC Browser Cache

# BEGIN s2Member GZIP exclusions
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wordpress/
    RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+
    RewriteRule .* - [E=no-gzip:1]
</IfModule>
# END s2Member GZIP exclusions

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

# END WordPress
# BEGIN Security advice from http://www.problogdesign.com/wordpress/11-best-ways-to-improve-wordpress-security/
# 8 – No Directories Should be Available for Browsing
# By default in most hosting, index of directories are shown in web browsers. This has a purpose but it also means that you reveal the content of any directory that has no index.html or index.php.

# Modifying this behavior is easy with Apache, just add the following line of code to the .htaccess file in the root directory (In the same place as the wp-config.php file).
Options All -Indexes
# END Security advice

Edit : Deactivated all plugins, did the sudo a2enmod rewrite and sudo /etc/init.d/apache2 restart. Enabled permalinks, refreshed the page. The .htaccess file was created automatically. Home page shows up ok (as always), none of the other pages/links work. I tried it on my localhost. My website is hosted on www.mcruiseon.com

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
share|improve this question
    
Please post your custom post type code so we can see how you are registering your post type. Have you visited the Settings->Permalinks page since you created your post type? –  Brian Fegter Jul 9 '12 at 17:06
    
Is it not working for only custom post type ? –  amit Jul 9 '12 at 17:21
    
It is not working for any page, post. –  Siddharth Jul 10 '12 at 6:48
add comment

4 Answers

up vote 2 down vote accepted
+50

Sounds like to that the Allow Override directive is still set to NONE for your VHOST

By default this is disabled, so even if you enable mod_rewrite via sudo a2enmod rewrite your .htaccess will be ignored.

You'll want to login to your server (via Terminal / shell) and then ...

sudo nano /etc/apache2/sites-available/default

look through the file for:

<Directory /var/www/>
    AllowOverride None
    Options MultiViews FollowSymlinks
    Order allow,deny
    Allow from all
    Header Set Cache-Control no-cache
</Directory>

Change the AllowOverride to ALL

Ctrl+x and save the file

then

sudo apache restart or sudo /etc/init.d/apache2 restart

see also http://drupal.org/node/134439

Let me know if the Allow Override was off please?

share|improve this answer
    
It was set to None, I made it All, and it worked. WOW this is just fantastic. Thanks a million. –  Siddharth Jul 15 '12 at 13:12
    
thanks for letting me know .. that's my first +50 bounty. Allow Override is 'so easy' once you know. PS ... you can also change /etc/apache/httpd.conf (i think) so Allow Override works in all directories. But that generally is not 'wise' –  Damien Jul 15 '12 at 20:09
    
Could you award the bounty please? see wordpress.stackexchange.com/faq#bounty –  Damien Jul 16 '12 at 7:59
    
Thanks Darnien. –  Siddharth Jul 16 '12 at 8:07
    
@Darnien I changed my site to use permalinks with post name, but all my urls (images in the page) got messed up. Am I missing something here. –  Siddharth Jul 26 '12 at 10:43
show 1 more comment

You have rewrite rules for two different caching plugins and s2 member in there. The error you receive means WordPress is not even processing the request. I suggest you disable your plugins, back up your htaccess file and then delete it, and then visit your permalinks settings page and save to have WordPress regenerate your rewrite rules. If there is a permissions issue with your htaccess file, you will see an error on the permalinks screen. Test your permalinks to see if they're working, then re-enable only the plugins you are using, which means choosing one caching plugin.

share|improve this answer
    
I have tried this 2 times already. It still does not work. –  Siddharth Jul 10 '12 at 6:44
    
did your htaccess file update? was WordPress able to write to it? if you put RewriteEngine On alone on the first line and get a 500 internal server error, you don't have mod_rewrite enabled, see Alm's answer as well. –  Milo Jul 10 '12 at 13:59
    
Yes, I tried the mod_rewrite to enabled as per Alm's response. The htaccess file did update, had a lot less stuff in it, since all plugins were off. But since it did not work with all the plugins off, I did not try the enabling one by one. –  Siddharth Jul 10 '12 at 15:16
    
if mod_rewrite is enabled, your Apache configuration may need an AllowOverride Directive to allow parsing of .htaccess files in directories. –  Milo Jul 10 '12 at 15:28
    
I have added AllowOverride too. –  Siddharth Jul 10 '12 at 15:33
add comment

Sounds to me like you don't have mod_rewrite enabled on your server?

If you have shell access to the server try: sudo a2enmod rewrite and then sudo /etc/init.d/apache2 restart

share|improve this answer
    
Tried, did not work. –  Siddharth Jul 10 '12 at 15:15
add comment

Have you tried, putting the last block at the top?.

My guess somewhere you end up in some sort of endless loop, or it just never reaches the actual wordpress rewrite.

Start from scratch, with only your wordpress urls, can you test that. and let us know if that worked. and keep working from there on. Doesn't surprise me it get's messed up looking like this.

share|improve this answer
    
I moved the last block above. Did not work. I deleted the .htaccess, disabled all plugins. Permalinks not working on basic, no plugin, setup also. I will add .htaccess (no plugin) in the original post above. –  Siddharth Jul 13 '12 at 8:39
    
Ok, so that doesn't work? Delete it completely, and go into your permalink settings and let wordpress recreate it. If you get no errors there, and it still doesn't work, I suggest you contact your hosting about it. –  woony Jul 13 '12 at 8:49
    
Its not working on localhost itself :). –  Siddharth Jul 13 '12 at 8:56
    
yeah, I just saw that , read over that... other hand I saw your hosted at godaddy, they have mod_rewrite so hosting shouldn't be a problem either. I'll think about what else could be wrong.. so you just get 404's? –  woony Jul 13 '12 at 8:57
1  
did you copy your index.php to your /wordpress/ and in your root? like this codex.wordpress.org/Giving_WordPress_Its_Own_Directory because this is what your .htaccess does. I think you will be able to fix it, follow the above link and set it up like they say. because your htaccess is same as mine, and I use index.php at root, and my wp files in wp folder. but you get redirected to your /wordpress so your .htaccess is not at the correct location or your index. Try it, let me know –  woony Jul 13 '12 at 9:01
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.