We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

NSM .htaccess Generator - Configuration Help

Development and Programming

switchjohnny's avatar
switchjohnny
2 posts
15 years ago
switchjohnny's avatar switchjohnny

I can’t seem to get this extension working properly on EE2.

I installed the extension and it doesn’t work quite right.

I’m using WAMP on my local machine, and I can navigate to http://mysite.local. However, I cannot view any other pages.

I get this error if I go to a new page. http://mysite.local/news_articles/view/top_story_article_3 You don’t have permission to access /news_articles/view/top_story_article_3 on this server.

NSM Generator Settings .htaccess path: /.htaccess

That’s the only path I can use where I don’t get a file not found error. The .htaccess file is in the root of my site.

General Configuration URL to the root directory of your site: http://mysite.local/

Any idea why I can’t get to any of my internal pages? Seems like I’m missing something simple.

       
Joseph Wensley's avatar
Joseph Wensley
38 posts
15 years ago
Joseph Wensley's avatar Joseph Wensley

Is it actually writing anything to the .htaccess?

Have you tried using a full path like “C:\wamp\www\mysite.htaccess”?

       
switchjohnny's avatar
switchjohnny
2 posts
15 years ago
switchjohnny's avatar switchjohnny
Is it actually writing anything to the .htaccess? Have you tried using a full path like “C:\wamp\www\mysite.htaccess”?

I used the full path, and now it is writing to the .htaccess file properly, but it is still not working.

same error about

Forbidden You don’t have permission to access /test on this server.

       
Joseph Wensley's avatar
Joseph Wensley
38 posts
15 years ago
Joseph Wensley's avatar Joseph Wensley

Did you enable mod_rewrite? To turn it on click the WAMP icon in the system tray go to Apache > Apache Modules and make sure rewrite_module is checked

Is your site outside the C:/wamp/www folder? If it is you may have to add something to your vhost config

Example vhost

<VirtualHost *:80> <Directory “C:\path\to\site”> AllowOverride all Order allow,deny Allow from all </Directory> DocumentRoot “C:\path\to\site” ServerName test.local </VirtualHost>
       
switchjohnny's avatar
switchjohnny
2 posts
15 years ago
switchjohnny's avatar switchjohnny
Did you enable mod_rewrite? To turn it on click the WAMP icon in the system tray go to Apache > Apache Modules and make sure rewrite_module is checked Is your site outside the C:/wamp/www folder? If it is you may have to add something to your vhost config Example vhost
<VirtualHost *:80> <Directory “C:\path\to\site”> AllowOverride all Order allow,deny Allow from all </Directory> DocumentRoot “C:\path\to\site” ServerName test.local </VirtualHost>

Yes, I have rewrite_module enabled.

My vhosts is configured like this.

<VirtualHost 127.0.0.1> DocumentRoot “C:/Work/Workspace/SLO/WEB” ServerName slo.local <Directory “C:/Work/Workspace/SLO/WEB”> Options +Indexes +FollowSymLinks Allow from all AllowOverride All </Directory> </VirtualHost>

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
15 years ago
Leevi Graham's avatar Leevi Graham

First question is can you see: http://mysite.local/index.php?news_articles/view/top_story_article_3/ . That will determine if this is actually a .htaccess issue.

       
ollieinlondon84's avatar
ollieinlondon84
2 posts
14 years ago
ollieinlondon84's avatar ollieinlondon84

I am having the same problem getting the extension to work when running EE on WAMP.

If I access http://localhost/index.php/about/contact I view the content, however, if I access http://localhost/about/contact I get NOT FOUND.

I specified the path the .htaccess file as just “.htaccess” as the file is in the root of the site.

The file is being written to by the extension as this is what is in the file:

– NSM .htaccess Generator Start –

.htaccess generated by NSM .htaccess Generator v1.1.3

@see: http://ee-garage.com/nsm-htaccess-generator

For more awesome .htaccess rules and optimisations

checkout the HTML5 Boilerplate .htaccess files

https://github.com/paulirish/html5-boilerplate/blob/master/.htaccess

Although highly unlikely, your host may have +FollowSymLinks enabled at the root level,

yet disallow its addition in .htaccess; in which case,

adding +FollowSymLinks will break your setup (probably a 500 error),

so just remove it, and your rules should work fine.

Options +FollowSymlinks

EE 404 page for missing pages

ErrorDocument 404 /index.php/about/404

Simple 404 for missing files

<FilesMatch “(.jpe?g|gif|png|bmp|css|js|flv)$”> ErrorDocument 404 “File Not Found” </FilesMatch>

Rewriting will likely already be on, uncomment if it isnt

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

</IfModule>

Block access to “hidden” directories whose names begin with a period. This

includes directories used by version control systems such as Subversion or Git.

<IfModule mod_rewrite.c> RewriteRule “(^|/).” - [F] </IfModule>

remove the www - Uncomment to activate

<IfModule mod_rewrite.c> RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] </IfModule>

Remove the trailing slash to paths without an extension

Uncomment to activate

<IfModule mod_rewrite.c>

RewriteRule ^(.*)/$ /$1 [R=301,L]

</IfModule>

Remove index.php

Uses the “include method”

http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method

<IfModule mod_rewrite.c>

RewriteCond %{QUERY_STRING} !^(ACT=.)$ [NC] RewriteCond %{REQUEST_URI} !(.[a-zA-Z0-9]{1,5})$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^/(about|global_embeds|news|search|members|P[0-9]{2,8}) [NC] RewriteRule (.) /index.php/$1 [L]

– NSM .htaccess Generator End –

Any pointers would be much appreciated.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.