Results 1 to 4 of 4

Thread: Help on .htaccess

  1. #1
    Join Date
    Nov 2005
    Location
    Philippines
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Help on .htaccess

    Need help on setting up .htaccess

    My subpages doesn't work without " / " at their end.

    example:
    Code:
    www.domain.com/subpage1
    (gets an error)
    while
    Code:
    www.domain.com/subpage1/
    (works normal)

    There must be a way to redirect (via htaccess) all "subpages" to "subpages/" but I just don't know how.

    Anyone knows how to do it?
    Thanks in advance.

  2. #2
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Which web server?

    Which web server are you using, Apache, Lighttpd, nginx or another?

  3. #3
    Join Date
    Nov 2005
    Location
    Philippines
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Which web server?

    Apache.
    I'm on a web host (hostgator) and they're using CentOS with Apache.
    I just need a solution via .htaccess

  4. #4
    Join Date
    Nov 2005
    Location
    Philippines
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Help on .htaccess

    Tried this one and it works on subpage1. Means, I have to enter a new entry for subpage2, subpage3 and so on.

    Code:
    RewriteCond %{REQUEST_URI} (.*)/subpage1?$
    RewriteRule ^(.*)$ %1/subpage1/ [NE,R,L]
    I tried:
    Code:
    RewriteCond %{REQUEST_URI} (.*)/*?$
    RewriteRule ^(.*)$ %1/*/ [NE,R,L]
    but it gives an error.

    What else can I do to avoid making a htaccess entry for each subpages?

Tags for this Thread

Bookmarks

Posting Permissions

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