.htaccess rewrite url remove CSS, JS and images no matter what i do it doesn't work


Ryan

I've looked at all the posts on stackoverflow and I've never gotten a response from what I've seen. I am using:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(?:css|js|jpe?g|gif|png)$ [NC]
RewriteRule profile/username/(.*)/ profile.php?username=$1
RewriteRule profile/username/(.*) profile.php?username=$1       

and im my profile, php header im using these tags:

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo ucwords($profileData->first_name); ?> - Facebook</title>
<link rel="stylesheet" href="/assets/css/style.css" type="text/css">
<base href="index.php" />

Everything I've done still doesn't work, please help!

Surillo

Since you're rewriting the rules, you'll also need to rewrite the base href HTML, or just add the full url to styles, js, and images. Basic href example:

   <head>
    <base href="https://www.yourwebsite.com/">
   </head>

Related


Matplotlib interactive mode doesn't work no matter what I do

username I am using python 3.7.7 and matplotlib 3.3.1 on Pycharm community 2020.1 I want to draw a graph and let the user decide if he likes the graph by providing some console input. This means I need matplotlib to work in interactive mode. I have tried many

Matplotlib interactive mode doesn't work no matter what I do

username I am using python 3.7.7 and matplotlib 3.3.1 on Pycharm community 2020.1 I want to draw a graph and let the user decide if he likes the graph by providing some console input. This means I need matplotlib to work in interactive mode. I have tried many

Matplotlib interactive mode doesn't work no matter what I do

username I am using python 3.7.7 and matplotlib 3.3.1 on Pycharm community 2020.1 I want to draw a graph and let the user decide if he likes the graph by providing some console input. This means I need matplotlib to work in interactive mode. I have tried many

Matplotlib interactive mode doesn't work no matter what I do

username I am using python 3.7.7 and matplotlib 3.3.1 on Pycharm community 2020.1 I want to draw a graph and let the user decide if he likes the graph by providing some console input. This means I need matplotlib to work in interactive mode. I have tried many

Matplotlib interactive mode doesn't work no matter what I do

username I am using python 3.7.7 and matplotlib 3.3.1 on Pycharm community 2020.1 I want to draw a graph and let the user decide if he likes the graph by providing some console input. This means I need matplotlib to work in interactive mode. I have tried many

htaccess rewrite to specific url doesn't work

Hermes I tried rewriting all languages to /en/ on the site. But I'm doing something wrong, don't know what. All domain requests (eg https://www.shop.com/de/ or https://www.shop.com/) must be rewritten to https://www.shop.com/en/ Why do I need this? First, my s

htaccess rewrite to specific url doesn't work

Hermes I tried rewriting all languages to /en/ on the site. But I'm doing something wrong, don't know what. All domain requests (eg https://www.shop.com/de/ or https://www.shop.com/) must be rewritten to https://www.shop.com/en/ Why do I need this? First, my s

htaccess URL rewrite doesn't work

username I created a .htaccess file to rewrite the url. But when I open the url which should be rewritten by htaccess, the url is not changed. Here is my .htaccess Options +FollowSymLinks -MultiViews RewriteEngine on RewriteRule seller/username/(.*)/ seller.ph

.htaccess url: rewrite doesn't work on localhost

Zeeshan Tahir I am new to .htaccess and my current url is: http://localhost/www.zeeshan.com/details.php?p_id=999 If I want to display my url like this it works fine for me. http://localhost/www.zeeshan.com/details/999 My .htaccess code is Options +FollowSym

.htaccess URL rewrite doesn't work

bee I wrote this code into a .htaccess file but it doesn't seem to work. RewriteEngine on Options +FollowSymLinks RewriteRule ^([^/]*)\.html$ /category/test.php?name=$1 [L] When writing http://example.com/z.html it automatically redirects me to a 404 file. Wh

.Htaccess URL Rewrite - Clean URL doesn't work

Yogsh M I'm trying to rewrite the URL, but I'm stuck. New URL : http://example.com/restaurants/restaurent name Original URL : http://example.com/restaurants-menu.php?rest=restaurent+name Code I have tried (doesn't work) RewriteEngine On RewriteRule ^rest/([^/]

.Htaccess URL Rewrite - Clean URL doesn't work

Yogsh M I'm trying to rewrite the URL, but I'm stuck. New URL : http://example.com/restaurants/restaurent name Original URL : http://example.com/restaurants-menu.php?rest=restaurent+name Code I have tried (doesn't work) RewriteEngine On RewriteRule ^rest/([^/]

$_GET doesn't work with .htaccess rewrite remove php extension

profit The following URLs: https://example.com/rewards.php&id=307658063902 (can't get ID via GET) or https://example.com/rewards&id=307658063902 (not found returns error) Doesn't work for retrieving GET variable IDs via php: $id = $_GET["id"]; I think there m

$_GET doesn't work with .htaccess rewrite remove php extension

profit The following URLs: https://example.com/rewards.php&id=307658063902 (can't get ID via GET) or https://example.com/rewards&id=307658063902 (not found returns error) Doesn't work for retrieving GET variable IDs via php: $id = $_GET["id"]; I think there m

$_GET doesn't work with .htaccess rewrite remove php extension

profit The following URLs: https://example.com/rewards.php&id=307658063902 (can't get ID via GET) or https://example.com/rewards&id=307658063902 (not found returns error) Doesn't work for retrieving GET variable IDs via php: $id = $_GET["id"]; I think there m

$_GET doesn't work with .htaccess rewrite remove php extension

profit The following URLs: https://example.com/rewards.php&id=307658063902 (can't get ID via GET) or https://example.com/rewards&id=307658063902 (not found returns error) Doesn't work for retrieving GET variable IDs via php: $id = $_GET["id"]; I think there m

$_GET doesn't work with .htaccess rewrite remove php extension

profit The following URLs: https://example.com/rewards.php&id=307658063902 (can't get ID via GET) or https://example.com/rewards&id=307658063902 (not found returns error) Doesn't work for retrieving GET variable IDs via php: $id = $_GET["id"]; I think there m

$_GET doesn't work with .htaccess rewrite remove php extension

profit The following URLs: https://example.com/rewards.php&id=307658063902 (can't get ID via GET) or https://example.com/rewards&id=307658063902 (not found returns error) Doesn't work for retrieving GET variable IDs via php: $id = $_GET["id"]; I think there m

$_GET doesn't work with .htaccess rewrite remove php extension

profit The following URLs: https://example.com/rewards.php&id=307658063902 (can't get ID via GET) or https://example.com/rewards&id=307658063902 (not found returns error) Doesn't work for retrieving GET variable IDs via php: $id = $_GET["id"]; I think there m

$_GET doesn't work with .htaccess rewrite remove php extension

profit The following URLs: https://example.com/rewards.php&id=307658063902 (can't get ID via GET) or https://example.com/rewards&id=307658063902 (not found returns error) Doesn't work for retrieving GET variable IDs via php: $id = $_GET["id"]; I think there m

$_GET doesn't work with .htaccess rewrite remove php extension

profit The following URLs: https://example.com/rewards.php&id=307658063902 (can't get ID via GET) or https://example.com/rewards&id=307658063902 (not found returns error) Doesn't work for retrieving GET variable IDs via php: $id = $_GET["id"]; I think there m

$_GET doesn't work with .htaccess rewrite remove php extension

profit The following URLs: https://example.com/rewards.php&id=307658063902 (can't get ID via GET) or https://example.com/rewards&id=307658063902 (not found returns error) Doesn't work for retrieving GET variable IDs via php: $id = $_GET["id"]; I think there m