/    Sign up×
Community /Pin to ProfileBookmark

Quick question on a PHP site

Hey everyone,

I am trying to use mod_rewrite to exchange my urls. I have created the htaccess file… below. It works for the first URLs however when linking ot the second set of URLS it pulls up the right information and queries the database but my stylesheet, javascript, and images wont load… any ideas?

[code=php]
RewriteEngine on

RewriteRule ^camping-and-hiking$ subcategory.php?type=camping
RewriteRule ^fishing$ subcategory.php?type=fishing
RewriteRule ^firearms-and-accesories$ subcategory.php?type=firearms
RewriteRule ^knives-and-swords$ subcategory.php?type=knives
RewriteRule ^police-equiptment$ subcategory.php?type=police
RewriteRule ^self-defense$ subcategory.php?type=self

RewriteRule ^(.*)/(.*)$ subcategory?type=$1&subcat=$2
[/code]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@pyroJul 28.2005 — You need to use absolute paths in your HTML, so these files can be loaded from sub-directories.
×

Success!

Help @New_to_PHP spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...