Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

htaccess question

Featured Replies

I just want to make sure I have this right...

 

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^display/(\w+)/$ post.php?p=$1 [nc]

Personally I'd put it in the IfModule tags just to be sure that the rewrite module is installed

Options +FollowSymlinks
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^display/(\w+)/$ post.php?p=$1 [NC]
</IfModule>

 

and change the nc to NC but other than that it looks fine

hmmm, it's still not working. Does it have to be in the root? If it helps, I'm trying to get

 

http://blog.jackbliss.co.uk/page.php?p=15

 

to look like

 

http://blog.jackbliss.co.uk/post/16/

 

or even better

 

http://blog.jackbliss.co.uk/16/

 

Is this even possible?

 

 

Options +FollowSymlinks
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^post/([0-9]+)$ page.php?p=$1 [NC]
</IfModule>

 

It needs to be placed in the root of your subdomain (httpdocs/public_html) on most hosts. Of course that's not going to include the trailing slash.

 

If you wished to have it like http://yoursite.com/16 you'd need to take into account that the image/ css/ etc folders would be rewritten too, therefore they would not function. To solve this problem you'd need to add a conditional and off the top of my head it'd look something like this:

 

Options +FollowSymlinks
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(images|css|style|index\.php)
RewriteRule ^post/([0-9]+)$ page.php?p=$1 [L]
</IfModule>

  • Author

For me, I have the folder for my subdomain set up to be http://jackbliss.co.uk/blog/, so if you visit that it shows the exact same thing as when you are look at the subdomain. Can I just put the .htaccess file inside this folder? I don't seem to have a httpdocs folder in my root directory. Does it work if I just make one?

 

I'm still kind of new to servers, I've never really touched a .htaccess before and I'm still learning. Sorry if I'm making any blaring mistakes.

For me, I have the folder for my subdomain set up to be http://jackbliss.co.uk/blog/, so if you visit that it shows the exact same thing as when you are look at the subdomain. Can I just put the .htaccess file inside this folder? I don't seem to have a httpdocs folder in my root directory. Does it work if I just make one?

 

I'm still kind of new to servers, I've never really touched a .htaccess before and I'm still learning. Sorry if I'm making any blaring mistakes.

That folder is fine.

Is the blog a wordpress installation? If so, simply put a blank .htaccess file in the same folder as the wp-config.php and then give it full write permissions (777). Then set the permalinks in the settings

Is the blog a wordpress installation? If so, simply put a blank .htaccess file in the same folder as the wp-config.php and then give it full write permissions (777). Then set the permalinks in the settings

 

+1, this would be much better - wordpress allows you to have the blog title as the slug. Give it full write permissions and then change them back (refer to CHMOD). (0777)

  • Author

no, sorry, its not. I wanted to see if I could do it my self, without wordpress. I know that wordpress is better, as it makes life a lot easier when doing this sort of thing, but I thought this would be better from a learning stand point.

Absolutely. I would suggest you take a look at the wordpress htaccess file however. You will see that it checks if a file or folder for the URI exists, and if not passes it to wordpress's index.php file which then processes the routing

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.