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

  • Home
  • SEARCH
  • 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 854067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:51:43+00:00 2026-05-15T07:51:43+00:00

I am playing with mod_rewrite now, and have successfully enabled it. However, I need

  • 0

I am playing with mod_rewrite now, and have successfully enabled it.

However, I need to put a htaccess file inside var/www/ in order to achieve what I want, which is to rename Urls simply…
When I place it my website becomes very strange and nothing basically works…

Is there any code I need to put into the htaccess file in order for things to act normally?

Here is the htaccess file I have so far:

Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/ad\.php
RewriteRule ^(.*)$ ad.php?ad_id=$1 [L]

My DocumentRoot is also set to var/www/ and my entire website root is there… (index.html etc etc)…

What am I missing about the htaccess?

If you need more input let me know…

  • 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-15T07:51:44+00:00Added an answer on May 15, 2026 at 7:51 am

    I suspect that none of your css files, js or images are loaded. Furthermore, none of your links work either. If so, the problem could be in the RewriteRule cause basically that rule is telling apache to pass all requests to ad.php

    You need to fine tune your RewriteRule, so that only the ad links are being affected by the rule.

    First, by expanding the RewriteRule like this:

    Options +FollowSymLinks
    Options +Indexes
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_URI} !^/ad\.php
    RewriteRule ^(.*)$ ad.php?ad_id=$1 [L]
    

    These 3 lines that I’ve added are telling apache to apply the rule only if the requested filename is not a directory, an existing file or a symbolic link – this should take care of the static content, such as the css and images. If your other pages where you’re links are pointing at, are also physically on the HDD of the server (plain html or php files), should start working again.

    But, as I already said on this question of yours (Little mod_rewrite problem) you need to fine tune that rule, so that only ads are being met by the rule and nothing else.

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

Sidebar

Related Questions

I'm playing with .htaccess and I was wondering if with just an .htaccess inside
Started playing around with jQuery and the jsTree plugin yesterday, and have it successfully
Been playing around with XCode for about 2 weeks now, and reading about MVC
I have been playing with BeautifulSoup, which is great. My end goal is to
Im playing around with NHibernate 3 alpha but struggling to set up my SessionFactory.
After playing a while with quote/unquote, I wanted to do a trick, but it
I've been playing around trying to create a transparent window that will overlay another
I'm working on playing audio from an audio stream using VC++ with the QtMultimedia
I was playing with creating a generic factory as follows: trait Factory[T] { def
I started playing around with web2py the other day for a new project. I

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.