2

I am redirect my url using htaccess and i use this code in .htaccess file

RewriteEngine On
RewriteRule ^mobile?$ index.php
RewriteCond ${REQUEST_URI} ^.+$
RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g|png|js|css|swf|php|ico|txt|pdf|xml)$ [OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -l
RewriteRule ^ - [L]
RewriteRule ^product/([0-9]+)/(.*)$ product.php?c=$1&title=$2 [QSA,L]

and also add this code in product.php 
<head> <base href="http://localhost/asp/" /> </head>

That code in product.php file. I redirect successfully but can not load css and js in proper way. Can any one suggest to me how can i load css and js on product.php page.I can load image successfully but page design is not working correctly.I have search a lot of but not get proper answer please any one can provide the way or code which is helpful for me.

6
  • Possible duplicate of Seo Friendly Url css img js not working Commented Apr 30, 2016 at 18:33
  • @starkeen this not working for me can you give any suggestion Commented Apr 30, 2016 at 18:42
  • Use an absolute path for your css,js and images ,ex /style.css instead of style.css Commented Apr 30, 2016 at 18:45
  • @starkeen i have done this but i don't know why is not working Commented May 1, 2016 at 4:27
  • How are your css,js and images loading? could you view the source of your webpage? Commented May 1, 2016 at 4:30

2 Answers 2

2

As you know, the default bahavior of base is to replace the url(adress) before the relative adress. example:

<base href="http://www.mywebsite.com/images/" target="_blank">

The browser will look for the image "html5.png" at "http://www.mywebsite.com/images/html5.gif".

Hope it help you !

Sign up to request clarification or add additional context in comments.

Comments

0

Create a main folder then putt all the files in folder like thisenter image description here ...

1 Comment

can you use include method?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.