Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
CMS made simple mod_rewrite
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- CMS made simple mod_rewrite
CMS made simple mod_rewrite
19-10-2010 11:53 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I have an htaccess file to rewrite CMSMS page urls to more friendly names. However i am getting an error when I set the site up on my cgi web space.
This is my htaccess file. Can anyone tell me what I am missing?
Thanks
This is my htaccess file. Can anyone tell me what I am missing?
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
Thanks
Message 1 of 3
(9,026 Views)
2 REPLIES 2
Re: CMS made simple mod_rewrite
20-10-2010 4:12 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
If the ccgi server is anything like the web server then you probably have problems with it reporting an overlong path and unexpected slashes. I had to write test rules that hard-redirected to a dummy page and dumped the variables into the URL, that way I could see what the variables contained and adjust the rule to compensate.
Message 2 of 3
(275 Views)
Re: CMS made simple mod_rewrite
22-10-2010 1:08 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: suzyb Options +FollowSymLinks
The security model suEXEC on new ccgi does not allow that Options line so it needs to be removed. The server configuration sets the equivalent of that by default. I think the file should work without that.
However suEXEC uses ~username mapping and %{REQUEST_URI} contains /~username/rest_of_url. So /~username will appear in the browser address line when a trailing slash is added. You could use %{ENV:SCRIPT_URL} if you don't want /~username to appear.
David
Message 3 of 3
(275 Views)
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- CMS made simple mod_rewrite