I am using gltf objects on my website with three.js. And I am using pretty links rules on my htaccess file. If I browse this url : https://yeni.elbielectric.com/gett.php my object is loading and appearing on page. But if I browse this url : https://yeni.elbielectric.com/urunler/zena/silverline/fildisi/anahtar/ object is loading but not disappearing. And I cannot see any console error. I think beacuse of htaccess rules there is a problem. Here is my htaccess content :
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^urunler/$ products.php [NC,L]
RewriteRule ^urunler/(.*)/(.*)/(.*)/(.*)/(.*)$ product-detail.php?prdname=$1&prddetail=$2&prdcolor=$3&functype=$4 [L]
RewriteRule ^products/(.*)/(.*)/(.*)/(.*)/(.*)$ product-detail.php?prdname=$1&prddetail=$2&prdcolor=$3&functype=$4 [L]
RewriteRule ^urunler/(.*)/(.*)$ product-list.php?prdname=$1 [L]
RewriteRule ^products/(.*)/(.*)$ product-list.php?prdname=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
there are some paths about my 3d objects and texture on js code. I think there is a problem about them.
for example : "../../../../../Models/ZenaVega/zena.gltf"
What is wrong?
Thanks.
With your shown samples/attempts, please try following .htaccess rules file. Please make sure to clear your browser cache before testing your URLs.
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^urunler/?$ products.php [NC,L]
RewriteRule ^(?:urunler|products)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ product-detail.php?prdname=$1&prddetail=$2&prdcolor=$3&functype=$4 [NC,QSA,L]
RewriteRule ^(?:urunler|products)/([^/]*)/?$ product-list.php?prdname=$1 [NC,QSA,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/$1\.php -f
RewriteRule ^(.*)/?$ $1.php [L]
Related
I want to rewrite this in SEO friendly url.
From - www.example.com/section.php?name=website
To - www.example.com/section/website
I tried this:
RewriteEngine On
RewriteRule ([^/\.]+)/([^/\.]+)?$ section.php?type=$1&service=$2 [NC,L]
I am fetching data using GET method in section.php and pass to the another page but after opening sub folder like www.example.com/{foldername} it returns to the section.php
Thanks. I will appreciate your help.
With your shown samples, please try following htaccess Rules file. Please make sure you clear your browser cache before testing your URLs.
RewriteEngine ON
##Rules for rewrite to section.php as per OP's request.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/?$ section.php?name=$1 [L]
This helps me
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteRule ([^/\.]+)/([^/\.]+)/?$ search.php?type=$1&service=$2
I need help with my htaccess file. I added the following to remove all .php extensions which is working fine.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
However I have a directory /users which I want to rewrite the URL strings. The current URL is like this:
aero.site/maki/users/index.php?t=mf5cc
I want the URL to look like
aero.site/maki/mf5cc
I used the following rewrite rule but it's giving me Object not found error:
RewriteRule ^([^/.]+)$ users/index.php?t=$1 [L]
My complete htaccess content is
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteRule ^([^/.]+)$ users/index.php?t=$1 [L]
Kindly help me with the correct rewrite rule for the last line to turn aero.site/maki/users/index.php?t=mf5cc into aero.site/maki/mf5cc
FYI: my htaccess file is in aero.site/maki directory
I finally got it to work. Thanks to #misorude. Here's my updated .htaccess content:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteRule ^([^/.]+)$ users/index?t=$1 [L]
I have my htaccess and it already does couple of good things (it hides www and .php in my url) but I also need to add one additional feature to it.
I have the main domain called: wdd.ie
I have a root folder called: wdd.ie
Most important files are kept in the root.
I have also the following file in the root: about.php
I love to access about.php file by calling non existing directory: www.wdd.ie/myweb/
And my full URL path looks like this: www.wdd.ie/myweb/about
I would like to access the file (stored in the root) to allow non existing directory in url but to ignore it
Could anyone help!? Please, please help!
As this new desired htaccess feature complexity is now probably beyond my skills.
<IfModule mod_rewrite.c>
DirectoryIndex index.php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
RewriteEngine on
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ / [L,QSA]
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
</IfModule>
If I've understood correctly you want the following url www.wdd.ie/myweb/about to offer up content from www.wdd.ie/about.php but keep the url the same?
If so, then the following should work
RewriteRule ^myweb/about$ /about.php [L]
Thanks for your help. I have been trying to solve this for an hour now.
I had this Htaccess that would rewrite /file.html to a script but decided to remove the extension and it turned out like this:
RewriteEngine On
#RewriteRule ^([^/]*)\.html$ /?file=$1 [L]
RewriteRule ^([^\.]+)$ /index.php?file=$1 [NC,L]
However, now I need it to work also with filename containing the dot (i.e. /file.with.dots) but that rule doesn't allow it.
This one works for files with dots but ending in .html
#RewriteRule ^(.*)\.html$ /index.php?file=$1 [NC]
This gets me an Internal Server Error
RewriteRule ^([^/]+)$ /index.php?file=$1 [NC,L]
You could just do this.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)/?$ /index.php?file=$1 [NC,L]
Let me know the result.
I have link like this for example http://localhost/somepage.php?id=1. And i want to make link like this http://localhost/somepage/1 but not just on somepage.php but for all pages on localhost. Here is my code for hidding .php extension and now i now i got http://localhost/somepage?id=1 and now i need to get http://localhost/somepage/1.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
You can replace your rule with this rule:
RewriteEngine On
RewriteRule ^([^/]+)/(\d+)/?$ $1.php?id=$1 [QSA,L]