Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2012
    Posts
    25
    Thanks
    4
    Thanked 1 Time in 1 Post

    .htaccess internal server error

    Hi all,

    I'm having an issue with a htaccess rule, under my document root I have the following htaccess file.

    Code:
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteCond %{HTTP_HOST} ^(my)\. [NC]
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
    This one works ok.

    Then under the /my/ folder I also have this htaccess file.

    Code:
    RewriteEngine On
    RewriteRule ^([^/]*)$ /index.php?p=$1 [L]
    This one throws up a 500 Internal Server Error.

    Im trying to change my files from index.php?p=page to just having /page/ for SEO URL's

    Any help would be fantastic as I'm rubbish with this and it's quite frustrating.

    Thanks

  • #2
    New Coder
    Join Date
    May 2012
    Posts
    25
    Thanks
    4
    Thanked 1 Time in 1 Post
    So after playing with this i've managed to get a bit further with loading my page.

    I'm now using:-

    Code:
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{HTTPS} off
    RewriteCond %{HTTP_HOST} ^(my)\. [NC]
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R]
    
    RewriteRule ^([^/]*)$ index.php?p=$1 [L]
    The issue with this now is that if I try to "get" p then it is getting index.php.

    Any further help would be much appreciated

    Thanks
    Last edited by probi; 01-12-2014 at 09:34 PM. Reason: Got a bit further

  • #3
    New Coder
    Join Date
    May 2012
    Posts
    25
    Thanks
    4
    Thanked 1 Time in 1 Post
    finally got this working after some research,

    just in case anybody else wants to know I have ended up using the following:-

    Code:
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{HTTPS} off
    RewriteCond %{HTTP_HOST} ^(my)\. [NC]
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R]
    RewriteRule ^(\w+)/?$ /index.php?p=$1 [L]
    Thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •