Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1111003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:28:48+00:00 2026-05-17T02:28:48+00:00

I am having some troubles with my script.. when I access http://www.domain.com/this-is-a-topic I want

  • 0

I am having some troubles with my script..

when I access http://www.domain.com/this-is-a-topic I want it to redirect to http://www.domain.com/index.php?t=this-is-a-topic… BUT when it says “administration”, “sitemap” or some other things, I want it to look either another rewrite condition or simply just get http://www.domain.com/administration/

Here is my code:

RewriteCond %{REQUEST_URI} !(administration|sitemap)/(.*)\. [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d


# Dync links

RewriteRule ^([a-zA-Z0-9-]+)/lang:([0-9]+)?$    index.php?t=$1&l=$2 [L]
RewriteRule ^lang:([0-9]+)?$                    index.php?l=$1 [L]


RewriteRule ^sitemap/?$                         index.php?sitemap=sitemap [L]

RewriteRule ^error/([0-9]+)?$                   index.php?error=$1
RewriteRule ^([a-zA-Z0-9-]+)/?$             index.php?t=$1 

The problem is, that when I write /administration/ it goes to http://www.domain.com/index.php?t=/administration/ instead of going to http://www.domain.com/administration/index.php

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T02:28:49+00:00Added an answer on May 17, 2026 at 2:28 am

    There’s two problems there. First, your condition

    RewriteCond %{REQUEST_URI} !(administration|sitemap)/(.*)\. [NC]
    

    will always be true, because the value of %{REQUEST_URI} always has a leading forward slash (so the pattern will always not match). You also likely don’t want to look for that dot for the cases where you browse to the sitemap and administration folders directly.

    Secondly, the conditions only apply to the very next rule, so while the folders would be ignored for the rule

    RewriteRule ^([a-zA-Z0-9-]+)/lang:([0-9]+)?$    index.php?t=$1&l=$2 [L]
    

    they would not be ignored for

    RewriteRule ^([a-zA-Z0-9-]+)/?$                 index.php?t=$1 
    

    There’s several ways to fix this, but the easiest might be to just ignore the rest of the rules in the case where any of your conditions match upfront, like this:

    # Don't rewrite and stop processing if any of the following is true
    RewriteCond %{REQUEST_URI} ^/(administration|sitemap)/ [NC,OR]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    
    # Dync links
    RewriteRule ^([a-zA-Z0-9-]+)/lang:([0-9]+)?$    index.php?t=$1&l=$2 [L]
    RewriteRule ^lang:([0-9]+)?$                    index.php?l=$1 [L]
    
    RewriteRule ^sitemap/?$                         index.php?sitemap=sitemap [L]
    
    RewriteRule ^error/([0-9]+)?$                   index.php?error=$1
    RewriteRule ^([a-zA-Z0-9-]+)/?$                 index.php?t=$1 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know it's possible with jQuery, but I'm having some serious troubles with this
Having some trouble sending properly formatted HTML e-mail from a PHP script. I am
I'm having some trouble figuring this out. I have a script that checks a
I'm having some trouble with MySQLdb when using it in a CGI script. I'm
I'm having some troubles using Session Variables as they are being used as Reference
I'm developing a website in WordPress and I'm having some troubles with the the
I'm having troubles with creating a simple list (some expandable lists are already working).
I am having troubles with jQuery's load function and am hoping for some help.
I'm trying to move some Excel-Data to MySQL, but having troubles with encoding. What
Been having some trouble implementing a single-column index in LaTeX. I've been employing the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.