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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:10:53+00:00 2026-06-11T14:10:53+00:00

OK guys, I have a problem that is literally driving me crazy. Here’s what

  • 0

OK guys, I have a problem that is literally driving me crazy. Here’s what happened :

I decided that I wanted to rewrite the URL on my web-site.

It is supposed to rewrite from this syntax :

http://www.sample.com/programming.php?name=something

to this :

http://www.sample.com/tutorials/programming/something.php

Or (eg. 2) :

http://www.sample.com/other.php?name=test

to this :

http://www.sample.com/tutorials/other/test.php

So my URL syntax would be :

http://www.sample.com/tutorials/(name of my file)/(name of the variable).php

I have tried the following code :

RewriteEngine On
RewriteRule ^tutorials/programming/(.+)$ /programming.php?name=$1 [L]
RewriteRule ^tutorials/other/(.+)$ /other.php?name=$1 [L]

But, it doesn’t rewrite the URL properly. The detailed explanation is below :

So, when I visit my original site, it appears like this :

http://www.sample.com/programming.php?name=something

If I visit this URL :

http://www.sample.com/tutorials/programming/something.php

I get my web-site HTML, but without my CSS layout (just HTML displayed). Also, if I click on any other link on non-CSS site, I get error 404. Note that the URL for the index.php site isn’t as it’s supposed to be :

http://www.something.com/index.php (Correct index.php URL)

but it’s like this :

http://www.sample.com/tutorials/programming/index.php (which does not exist).

I have read over 10 tutorials online, asked my colleague to help me out, but neither did his solutions work. So, all I want to accomplish is that my URL is rewritten, so when the user choose a tutorial in programming, I don’t get this URL in the address bar :

http://www.sample.com/programming.php?name=something

but this :

http://www.sample.com/tutorials/programming/something.php

and that is all I want.

I have tried to be as detailed as possible. If you need additional details, please, let me know.

Thanks in advance!

  • 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-11T14:10:54+00:00Added an answer on June 11, 2026 at 2:10 pm

    I get my web-site HTML, but without my CSS layout (just HTML displayed). Also, if I click on any other link on non-CSS site, I get error 404. Note that the URL for the index.php site isn’t as it’s supposed to be :

    The relative/absolute paths you have in your page content is getting a different base because of the extra slash. When you have something like <img src="images/blah.gif">, the relative base is derived from the URL the browser sees (not what is internally re-written by the server). So if the browser sees: http://www.sample.com/programming.php?name=something, the URI is /programming.php and the URI base is /. But if the browser sees http://www.sample.com/tutorials/programming/something.php, the URI is /tutorials/programming/something.php and the URI base becomes /tutorials/programming/, which I’m assuming is not where your images/css/scripts/etc are located (since that directory probably doesn’t even exist).

    You need to either correct the URI base in all of your page headers by adding a:

    <base href="/">
    

    Or change all of your relative links to absolute links.

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

Sidebar

Related Questions

I have a problem that has been driving me crazy and I'd appreciate any
Hey guys, I have a weird problem. I have an update system that refreshes
guys. I have a strange problem. I try to write unit-tests to web-app. I
I have this problem driving me crazy. I have spent decades to figure it
i guys i have a problem, i want to run a haskell script that
that's my first post here. I have problem with managing activities. I have my
Hey guys i have a problem. I have a listview that is dynamically filled.
Hi guys I have a problem that makes me really confused, I have 'writeMethod'
Hi guys I have a problem at hand that I can't seem to figure
i have a logic problem that maybe you smart guys can help me to

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.