php


CSS not loading after URL rewriting


I am trying to rewrite URL from example.com/test.php?id=hd3j3 to example.com/id/hd3j3.
The problem is rewriting occurs and I am taken to the page but the css and js of the page doesn't load. Where am I going wrong?
.htaccess
RewriteBase /
RewriteEngine On
RewriteRule ^id/([A-Za-z0-9]+)$ test.php?id=$1 [L]
Your rewrite rule looks right for me.
Maybe your css gets loaded from a relative path and not absolute ?
<link href="css/layout.css">
The browser try to load from example.com/id/css/layout.css instead of example.com/css/layout.css
Try to clear the cache and retry ! This usually works.Or set the root path correctly.
If these won't work try this,
If you want to use image tag and show to correctly images, use
" />

Related Links

How to do a PHP POST to external webapi in Grav CMS?
Add low stock alert on category page magento 1.9.3
Wordpress + ACF: the_title and the_permalink repeat values through loop
Magento: Adding a 2nd Contact Form with a new form action
Update all entries with old date SQL in PHP
PHPUnit test method is called multiple times with specific arguments in no specific order
Inserting form data to two rows in database
What is the right syntax for MySQL injection security for $_GET[] and wildcard
ZF2 ProgressBar only update after too many “updates”
zend framework skeleton: why does the line require 'init_autoloader.php' work?
How to create dynamic classes using PHP and using with jQuery
How to resize and watermark on an image at a time using CodeIgniter?
SOAP Authentication of Username Password Token Failed
Php Group array by value and count group item
Laravel model issue (non-object)
Someone point my website with his domain, how can I block? [closed]

Categories

HOME
knockout.js
macos-sierra
azure-functions
biztalk
celery
lvm
google-sheets-query
tfs2015
flurry
share
angular2-template
tfs2010
stack-overflow
fbloginview
vimeo
bootstrap-switch
pm2
createjs
fresco
rest-assured
c#-7.0
rpmbuild
opam
yii2-basic-app
unity-container
backtracking
websphere-portal
software-packaging
vuforia
web-config-transform
amazon-cloudtrail
bitbake
mdns
xenapp
source-insight
autodesk-model-derivative
winsock
knights-tour
cucumber-junit
android-collapsingtoolbar
markov-chains
directfb
djcelery
nanogallery
unification
plane
1wire
minikube
google-prediction
axis
webalizer
sonicmq
entropy
android-webservice
webvtt
glimpse
front-camera
http4s
pbx
cocoa-bindings
okio
openquery
zynq
carmen
android-sdcard
yii2-model
jemdoc
swiffy
utf-16
wikimedia-commons
grinder
fanotify
auto-generate
gitlab-omnibus
wso2ml
green-threads
componentart
kefir.js
com0com
python-c-extension
comctl32
iodocs
window-resize
quantify
csslint
rails-api
pageviews
gpu-programming
pre
rautomation
hints
ldif
oscilloscope
chefspec
user-forums
semantic-merge
spark-view-engine
gitx
story
thejit
system-information
first-class
uipangesturerecognizer
mvcrecaptcha
rtd
tablet-pc
jquery-1.4
css-friendly
reliability
raw-data
firephp
database-cloning
version-control-migration
server-load
service-factory
jvm-bytecode

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App