RevCMS url rewrite remove index.php?url=

Results 1 to 7 of 7
  1. #1
    Member dimaklt is offline
    MemberRank
    Dec 2015 Join Date
    GermanyLocation
    56Posts

    config RevCMS url rewrite remove index.php?url=

    Hi!
    I'd like to have /index instead of /index.php?url=index but when I remove the index.php?url= from class.html.php I get a ERR_TOO_MANY_REDIRECTS error.
    Also /news/<id> and /profile/<username> would be nice too.
    How to edit my .htaccess to be as I want it?
    Code:
    RewriteEngine On
    RewriteRule ^(|/)$ index.php?url=$1
    RewriteRule ^([a-zA-Z0-9_-]+)(|/)$ index.php?url=$1
    RewriteEngine on
    RewriteRule ^(.*)\.htm$ $1.php [NC]
    RewriteRule ^(|/)$ dash.php?page=$1
    RewriteRule ^([a-zA-Z0-9_-]+)(|/)$ dash.php?url=$1


  2. #2
    Apprentice BetaJedi is offline
    MemberRank
    Apr 2014 Join Date
    UKLocation
    22Posts

    Re: RevCMS url rewrite remove index.php?url=

    You can use programs such as Helicon Ape to edit the .htaccess file. This will do what you want it to do:

    Code:
    RewriteEngine On
    
    RewriteRule ^(|/)$ index.php?url=$1
    RewriteRule ^([a-zA-Z0-9_-]+)(|/)$ index.php?url=$1
    RewriteEngine on
    RewriteRule ^(.*)\.htm$ $1.php [NC]
    
    RewriteRule ^(|/)$ dash.php?page=$1
    RewriteRule ^([a-zA-Z0-9_-]+)(|/)$ dash.php?url=$1
    RewriteRule ^(community/staff)$ staff
    RewriteRule ^home/([a-zA-Z0-9_-]+)(|/)$ index.php?url=home&user=$1
    
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(([A-Za-z0-9\-]+/)*[A-Za-z0-9\-]+)?$ $1.php
    
    # To internally redirect /dir/foo to /dir/foo.php
    RewriteCond %{REQUEST_FILENAME}.php -f
    RewriteRule ^ %{REQUEST_URI}.php [L]
    Sorry that there is extra stuff in there, I just copied and pasted it from mine, but you're welcome to manipulate it however you see fit.

    Hope this helps! Let me know if it doesn't!

  3. #3
    Member dimaklt is offline
    MemberRank
    Dec 2015 Join Date
    GermanyLocation
    56Posts

    Re: RevCMS url rewrite remove index.php?url=

    Thank you! It's working
    Everything else I tried only gave me redirect errors.

  4. #4
    Apprentice BetaJedi is offline
    MemberRank
    Apr 2014 Join Date
    UKLocation
    22Posts

    Re: RevCMS url rewrite remove index.php?url=

    Quote Originally Posted by dimaklt View Post
    Thank you! It's working
    Everything else I tried only gave me redirect errors.
    No worries, glad I could help! :-)

  5. #5
    Member dimaklt is offline
    MemberRank
    Dec 2015 Join Date
    GermanyLocation
    56Posts

    Re: RevCMS url rewrite remove index.php?url=

    Quote Originally Posted by BetaJedi View Post
    No worries, glad I could help! :-)
    Only issue left /home/<user> fails loading of css and js (adds /home to links) and I can't fix it..

  6. #6
    Apprentice BetaJedi is offline
    MemberRank
    Apr 2014 Join Date
    UKLocation
    22Posts

    Re: RevCMS url rewrite remove index.php?url=

    Quote Originally Posted by dimaklt View Post
    Only issue left /home/<user> fails loading of css and js (adds /home to links) and I can't fix it..
    Try removing this line?

    Code:
    RewriteRule ^home/([a-zA-Z0-9_-]+)(|/)$ index.php?url=home&user=$1
    Or, it could also be that the .php file for your user home is using a "..\style.css" link to access the CSS or something similar, and due to the URL rewriter, it is trying to access "/home/style.css" rather than the real location.
    Try manipulating the link to a hard location, such as
    Code:
    link rel="http://hotelname.link/path/style.css"

  7. #7
    Member dimaklt is offline
    MemberRank
    Dec 2015 Join Date
    GermanyLocation
    56Posts

    Re: RevCMS url rewrite remove index.php?url=

    Quote Originally Posted by BetaJedi View Post
    Try removing this line?

    Code:
    RewriteRule ^home/([a-zA-Z0-9_-]+)(|/)$ index.php?url=home&user=$1
    Or, it could also be that the .php file for your user home is using a "..\style.css" link to access the CSS or something similar, and due to the URL rewriter, it is trying to access "/home/style.css" rather than the real location.
    Try manipulating the link to a hard location, such as
    Code:
    link rel="http://hotelname.link/path/style.css"
    config.php
    Code:
    $config = (object) array(
            'hotel' => (object) array(
                    'url' => 'http://localhost/'
            )
    );
    class.css.phpworking, but with /home/
    Code:
    foreach (glob($template->url."app/tpl/skins/".$config->template."/src/css/*.css") as $filename) {        $this->css = '<link rel="stylesheet" href="'.$filename.'">';
            $this->setCSS();
    
          }
    not working (not even adding link to source)
    Code:
    foreach (glob($config->hotel->url."app/tpl/skins/".$config->template."/src/css/*.css") as $filename) {        $this->css = '<link rel="stylesheet" href="'.$filename.'">';
            $this->setCSS();
          }

    EDIT:

    Found out that <base href="'.$config->hotel->url.'"> inside head works fine.
    Last edited by dimaklt; 10-07-17 at 09:07 PM.



Advertisement