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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:54:59+00:00 2026-05-21T21:54:59+00:00

Hi I want to rewrite my site URLs. Now I am using PHP 5

  • 0

Hi I want to rewrite my site URLs. Now I am using PHP 5 for development. I tried with the following .htaccess.

RewriteEngine on

RewriteRule   ^(.*)/(.*).html$ $1.php?code=$2 [L]
RewriteRule   ^(.*).html$ $1.php [L]

The URL without argument is working, but the first one shows some problems. It redirects to the page, but the page styles are missing whatever value I pass for code.
Why is it happening? Is there any option for rewriting URLs using PHP5?

  • 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-21T21:55:00+00:00Added an answer on May 21, 2026 at 9:55 pm

    If you redirect to ‘folder/file.html’ all of your relative links will be messed up. It will be looking for ‘css/style.css’ in ‘folder/css/style.css’ instead.

    You can either use absolute links i.e. ‘www.example.com/css/style.css’ or rewrite your link paths as well.

    RewriteRule   ^(.+)/css/(.+)$ css/$2 [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

want to rewrite urls like site.com/software to wp-content/themes/dir/software.php and something is not working.. Here's
I'm using CodeIgniter and .htaccess to rewrite the URLs but I want it to
I want to rewrite all URLs of the form: http://www.site.com/push20/dir1/dir2/afile.html to http://www.site.com/dir1/dir2/afile.html I.e. lose
I want to rewrite http://website.com/?slug=product_info.php&products_id=32 to http://website.com/product_info/32 and I use this code, add_filter('rewrite_rules_array','wp_insertMyRewriteRules'); add_filter('query_vars','wp_insertMyRewriteQueryVars');
I have following LINQ statement and I want to rewrite it using extension methods.
I am using Nginx, and I want to rewrite all url with the following
I am using CodeIgniter for my site and I want to shorten my URLs
I'm working on a project to rewrite an aspx site as MVC3. I want
I want to rewrite core/adminthtml/block/widget/tabs.php class which is a super class for core/adminhtml/block/sales/order/view/tabs.php class.
I'm having a hard time with .htaccess. I want to create friendly URLs for

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.