1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice

How to solve htaccess issue

Discussion in 'Web Design' started by Kingmati, Jan 14, 2020.

  1. Kingmati

    Kingmati Registered Member

    Joined:
    Oct 30, 2019
    Messages:
    51
    Likes Received:
    2
    Gender:
    Male
    Am using buzzy viral php news script for my main site, so i create a folder in my cpanel called forum and upload ips community php script on it for forum, but when i type my domain/forum it will be showing me error. When i remove a line of code in my htaccess. It will open but the main site that is using buzzy script will not open.

    Here is what a talking about. buzzicati.com.ng is working but buzzicati.com.ng/forum is not working
     
  2. Mr Crabs

    Mr Crabs Junior Member

    Joined:
    May 24, 2018
    Messages:
    174
    Likes Received:
    166
    Gender:
    Male
    Location:
    Bikini Bottom
    the easiest fix would be to have the forum on a subdomain since that way you can have separate htaccess files that don't conflict since from a quick glance it looks like the scripts just don't play well with each other.
     
  3. Gogol

    Gogol Jr. VIP Jr. VIP

    Joined:
    Sep 10, 2010
    Messages:
    5,971
    Likes Received:
    5,883
    Gender:
    Male
    Occupation:
    Programmer
    Location:
    Pale Blue Dot
    Home Page:
    Paste your htaccess here.. Error seems to be redirect related. Probably easy to solve.
     
  4. SmartPlay

    SmartPlay Jr. VIP Jr. VIP

    Joined:
    Jan 21, 2019
    Messages:
    273
    Likes Received:
    174
    Gender:
    Male
    Home Page:
    The problem is in your forum htaccess file. You must have another htaccess file generated by IPS. Go to the settings panel and find friendly URL or rewrite URLs. That should be checked. Then IPS will auto generate new htaccess file. Check the privileges if IPS can write in the forum folder.
     
  5. Kingmati

    Kingmati Registered Member

    Joined:
    Oct 30, 2019
    Messages:
    51
    Likes Received:
    2
    Gender:
    Male
    here is the htaccess code

    <IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
    RewriteRule ^(.*)$ public/$1 [L]
    </IfModule>
     
  6. lorentzo

    lorentzo Jr. VIP Jr. VIP

    Joined:
    Nov 14, 2010
    Messages:
    1,654
    Likes Received:
    875
    Gender:
    Male
    Location:
    Home
    You should have 2 httaccess files
     
  7. Kingmati

    Kingmati Registered Member

    Joined:
    Oct 30, 2019
    Messages:
    51
    Likes Received:
    2
    Gender:
    Male
    how do i create the second httaccess file
     
  8. SmartPlay

    SmartPlay Jr. VIP Jr. VIP

    Joined:
    Jan 21, 2019
    Messages:
    273
    Likes Received:
    174
    Gender:
    Male
    Home Page:
    OMG man just read my last post. I TOLD u that EXACTLY
     
  9. Kingmati

    Kingmati Registered Member

    Joined:
    Oct 30, 2019
    Messages:
    51
    Likes Received:
    2
    Gender:
    Male
    you only said i need to have two htaccess file.
     
  10. Gogol

    Gogol Jr. VIP Jr. VIP

    Joined:
    Sep 10, 2010
    Messages:
    5,971
    Likes Received:
    5,883
    Gender:
    Male
    Occupation:
    Programmer
    Location:
    Pale Blue Dot
    Home Page:
    Well I am not sure what that RewriteRule ^(.*)$ public/$1 [L] does here. Do you have a public folder where you are redirecting the requests?
    Anyways, my best guess is that the sub folder can't be accessed because of this particular rule only. It does not check whether the requested folder/file exists before redirecting to public/$1.

    Try this may be:

    Code:
    <IfModule mod_rewrite.c>
        Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
    
    RewriteCond ${REQUEST_FILENAME} !-f
    RewriteCond ${REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ public/$1 [L]
    </IfModule>
    
    Now, chances are that this may not work. In case it doesn't, you could PM me a snapshot of your folder structure. I will try to help you out. :)
     
    Last edited by a moderator: Jan 14, 2020
  11. SmartPlay

    SmartPlay Jr. VIP Jr. VIP

    Joined:
    Jan 21, 2019
    Messages:
    273
    Likes Received:
    174
    Gender:
    Male
    Home Page:
    NO, I told you how IPS can generate that file automatically.
     
  12. Kingmati

    Kingmati Registered Member

    Joined:
    Oct 30, 2019
    Messages:
    51
    Likes Received:
    2
    Gender:
    Male
    i tried it but is not working.
    here is the screenshoot of the folders View attachment 126313 View attachment 126313 View attachment 126313 View attachment 126313
    i have tried it but is not working.
    here is the folder screenshot
    i think the htaccess is only redirecting to this public/$1 folder
    folder.JPG
     
  13. Kingmati

    Kingmati Registered Member

    Joined:
    Oct 30, 2019
    Messages:
    51
    Likes Received:
    2
    Gender:
    Male
    okay, but i cant access the forum unless i remove this code from the htaccess file. RewriteRule ^(.*)$ public/$1 [L]
     
  14. SmartPlay

    SmartPlay Jr. VIP Jr. VIP

    Joined:
    Jan 21, 2019
    Messages:
    273
    Likes Received:
    174
    Gender:
    Male
    Home Page:
    You can't access the forum but you can access the admin panel because admin panels don't use rewrite urls. Just open https://yourdomain.com/forum/admin/, you should be able to access the admin panel
     
  15. Kingmati

    Kingmati Registered Member

    Joined:
    Oct 30, 2019
    Messages:
    51
    Likes Received:
    2
    Gender:
    Male
    i cant access it
    buzzicati.com.ng/forum/admin
     
  16. Gogol

    Gogol Jr. VIP Jr. VIP

    Joined:
    Sep 10, 2010
    Messages:
    5,971
    Likes Received:
    5,883
    Gender:
    Male
    Occupation:
    Programmer
    Location:
    Pale Blue Dot
    Home Page:
  17. Kingmati

    Kingmati Registered Member

    Joined:
    Oct 30, 2019
    Messages:
    51
    Likes Received:
    2
    Gender:
    Male
    okay thanks, i will be waiting for you reply
     
  18. Gogol

    Gogol Jr. VIP Jr. VIP

    Joined:
    Sep 10, 2010
    Messages:
    5,971
    Likes Received:
    5,883
    Gender:
    Male
    Occupation:
    Programmer
    Location:
    Pale Blue Dot
    Home Page:
    Do you get a server error when you try my code?

    Try this instead (I just tried the htaccess rules in my local wamp server, and it worked as intended).

    Code:
    Options +FollowSymLinks
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ public/$1 [L]
    </IfModule>
    
    If it still does not work, probably there's a problem with your rewrite module. Not configured properly may be..
     
  19. Kingmati

    Kingmati Registered Member

    Joined:
    Oct 30, 2019
    Messages:
    51
    Likes Received:
    2
    Gender:
    Male
    check it out you will see it is showing all my site folder, but if i click on public and forum they will open.
     
  20. Kingmati

    Kingmati Registered Member

    Joined:
    Oct 30, 2019
    Messages:
    51
    Likes Received:
    2
    Gender:
    Male
    buzzicati.com.ng