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 8433849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:30:00+00:00 2026-06-10T06:30:00+00:00

I am using mod_rewrite to create prettier URLs for a website I am working

  • 0

I am using mod_rewrite to create prettier URLs for a website I am working on. However a redirect loop is being caused for my css and js folders.

Here is what is in my .htaccess

AddDefaultCharset On
AddDefaultCharset UTF-8
AddCharset UTF-8 .tpl
AddCharset UTF-8 .js
AddCharset UTF-8 .css
AddCharset UTF-8 .php

RewriteEngine On
RewriteBase /guildtree/
RewriteRule ^([a-zA-Z0-9_'-]+)/(.*)$        characters.php?realm=$1&name=$2     [NC]

My CSS is being redirected to

http://localhost/guildtree/css/error

and my JS is being redirected to

http://localhost/guildtree/js/error

My images are all coming up broken as well, even though the path to them is correct. Going to the images directly results in a redirect loop as well.

http://localhost/guildtree/images/roster/error

Is there anything that stands out as the reason to be causing this loop? Thanks.

Update:

The issue with the CSS and images have been resolved. The JS still doesn’t work though.

  • 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-06-10T06:30:02+00:00Added an answer on June 10, 2026 at 6:30 am

    This isn’t a redirect loop, your images are probably getting caught by the characters.php route. Add some exclusions to your rule:

    RewriteBase /guildtree/
    
    RewriteCond %{REQUEST_URI} !\.(css|js|png|jpe?g|gif)$ [NC]
    RewriteRule ^([a-zA-Z0-9_'-]+)/(.*)$        characters.php?realm=$1&name=$2     [NC]
    

    Additionally, you may have a relative/absolute pathing issue. If your links are relative, they will be changed by the new path and you need to add a:

    <base href="/guildtree/">
    

    Or whatever the base path should be for all your relative links.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an .htaccess file using mod_rewrite to redirect URLs from the old website
I am using mod_rewrite to remap the URLs in my website in the following
I am using mod_rewrite to create SEO URLs. Basically the thing works in the
I'm using preg_replace to create urls for modrewrite based paging links. I use: $nextURL
I am trying to redirect pages using mod_rewrite to the pages with some variables
I've been using mod_rewrite in my htaccess file to rewrite my urls and I've
Got a question about using mod_rewrite to redirect specific subdomains to use another domain.
I am trying to rewrite URLs using mod_rewrite. It is enabled in httpd.conf and
I am using a mod_rewrite rule to create SEO friendly URL's. This is my
Initially, this code was written to create pretty urls. When using the code below,

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.