- This topic is empty.
-
AuthorPosts
-
October 12, 2010 at 5:09 am #30499coffeendonutMember
i want to know if is it possible to hide the file extension example if i have
http://mysite.com/thisnew.html rewrite it to http://mysite.com/thisnew
another example
https://css-tricks.com/forums/categories/css
i use the following .htaccess code
RewriteEngine on
RewriteRule ^mynew/$ /mynew.html [L]
RewriteRule ^most/$ /most.php [L]
is there a way on making this hide all the html extension and not having to include all the page’s on the htaccess file .?
October 12, 2010 at 11:10 am #78230Chris CoyierKeymasterThey are folders with index inside them.
Ex.
http://mysite.com/thisnew/index.html = http://mysite.com/thisnew
October 12, 2010 at 4:29 pm #78201coffeendonutMember@CWDESIGN some are index but others ain’t as the example above http://www.mysite.com/mynew.html/ becomes http://www.mysite.com/mynew/ an is not an index on a folder im trying basically to remove every .html to just the name without having to write every page on the .htaccess file…
October 12, 2010 at 4:32 pm #78191coffeendonutMember@dclardy thats good i have tried that but i need to remove every .html and .php extension and not having to name it something else… basically no file extensions…
October 12, 2010 at 4:41 pm #78192Chris CoyierKeymasterWhat you’re trying to do just doesn’t make sense to me. What I think I understand is that you want to remove the “.html” and “.php”.
October 12, 2010 at 4:53 pm #78193coffeendonutMember@CWDESIGN yes… the .html and the .php extension…
October 12, 2010 at 5:04 pm #78189Chris CoyierKeymasterWell, the only way I know how to remove the .html and .php extensions is to create a folder and put index.html or index.php inside of that folder. Adding a folder and naming the file index will make it so your page will look like this mysite.com/thisnew without showing the .html or .php extension.
October 12, 2010 at 5:18 pm #78190coffeendonutMember@CWDESIGN yeah thats the original way that works… cause thats the index of the folder but im not trying to make multiple folders just for a page… thats where the .htaccess come’s in handy the .htaccess file above renames the the file to which ever name you want like RewriteRule ^most/$ /most.php [L] the url will be http://www.mysite.com/most/ without having to make or name a folder and put and index on it…
October 12, 2010 at 5:22 pm #78181Chris CoyierKeymasterI SEE! I was confused as to what you were trying to do. Now that makes sense.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.